Error 422 on POST DocumentReference

107 views
Skip to first unread message
Assigned to Fenil....@cerner.com by me

David

unread,
Aug 5, 2021, 1:17:57 PM8/5/21
to Cerner FHIR Developers
Hi Cerner Team,
 
i'm trying to create a document reference using R4 API https://fhir.cerner.com/millennium/r4/foundation/documents/document-reference/#create.

However I receive a client error - HTTP 422.

The reason for this could be the mismatching Practitioner ID, that have to be used as author in the post request. In this thread https://groups.google.com/g/cerner-fhir-developers/c/AMY4HxK8aks/m/h4_Kc6ixCQAJ it is recommended to obtain the authorized user (Practitioner ID) using OpenID Connect. 

Is there any other way to get the Practitioner ID after a successful authorization? Can it be determined based on the access token on R4? This is possible according to the DSTU2 API for the same request https://fhir.cerner.com/millennium/dstu2/infrastructure/document-reference/#example-2.

Thank you,
David

Fenil Desani (Cerner)

unread,
Aug 5, 2021, 3:13:15 PM8/5/21
to Cerner FHIR Developers
Hello, 

Please provide the X-Requet-id of your failure and post body!

Thanks,
Fenil

David

unread,
Aug 5, 2021, 6:37:14 PM8/5/21
to Cerner FHIR Developers
Hello Fenil,

thank you for the fast response.

Status code: 422

X-Request-Id: 63f01fa4-2f2d-4eed-9fd0-76189f95e549

Body Data

{
   "resourceType":"DocumentReference",
   "status":"current",
   "docStatus":"final",
   "type":{
      "text":"Height Weight Allergy Rule - Text",
      "coding":[
         {
            "code":"20732501",
            "system":"https:\/\/fhir.cerner.com\/ec2458f2-1e24-41c8-b71b-0e701af7583d\/codeSet\/72",
            "display":"Height Weight Allergy Rule - Text",
            "userSelected":true
         }
      ]
   },
   "subject":{
      "reference":"Patient\/53663272"
   },   
   "author":[
      {
         "reference":"Practitioner\/21500981"
      }
   ],
   "authenticator":{
      "reference":"Practitioner\/21500981"
   },
   "content":[
      {
         "attachment":{
            "data":"PGh0bWw+Cjx0aXRsZT4gVGVzdCBEb2N1bWVudCA8L3RpdGxlPgoKRG9jdW1lbnQgY29udGVudCEKCjwvaHRtbD4=",
            "title":"Height Weight Allergy Rule - Text",
            "creation":"2020-07-29T21:02:04.000Z",
            "contentType":"application\/xml;charset=utf-8"
         }
      }
   ],
   "context":{
      "period":{
         "start":"2020-01-01T00:00:00.000Z",
         "end":"2020-01-01T00:00:00.000Z"
      },
      "encounter":[
         {
            "reference":"Encounter\/4208059"
         }
      ]
   }
}

Thank you,
David

Fenil Desani (Cerner)

unread,
Aug 6, 2021, 10:56:33 AM8/6/21
to Cerner FHIR Developers
You don't need to provide authenticator field if you have a Provider App.

And for Author,
  • Notes
    • Must contain only Practitioner references with valid millennium ids. Optional for system access. For provider access, only a single author can be provided, and it must be the authorized provider.
The Id of the authorized user should be found from the openId token.

Thanks,
Fenil
Screen Shot 2021-08-06 at 9.48.08 AM.png
Reply all
Reply to author
Forward
0 new messages