This wiki has undergone a migration to Confluence found Here

201709 Consumer Centered Data Exchange Implementation Notes for test.fhir.org

From HL7Wiki
Jump to navigation Jump to search

JWT Cert

You can get the JWT cert from [[1]] which directs you to here: [[2]]

The unpacked JWT is:

{

 "alg" : "RS256",
 "e" : "AQAB",
 "kid" : "https://test.fhir.org/auth3/auth_key",
 "kty" : "RSA",
 "n" : "pWGCPEp8PNjfiTHNM_iB5JqC4SyfVJoAR8urI1guoFtfPPlH2c_ZO1p4S0W1rAy8qi_lLLOKmiTL2JDqd6xUA6AHcf8Fr7cwAJiqQBd-3AMOfm7fSIgVgKQXCFQAzTAefJYq4f7ydnkocrDuKSH29QhhlBqVIu3TwKNQUGs6Owk1HRRtxIlxHJRCNEbA-AFdjT4A5JKztyYaA5IiWr2cgU-q71_SeMDWUNHZNeBO7HJu0Jh7uX-9xhpSr8J3zt9kMBbFzIwH1ycglJ9e4yhFA5y5VE-ZjBvSnDrfC5J22IoEvzBOSuzy33D6Y4vbH26g7slh90atsMbzuTHJu7iaQQ",
 "use" : "sig"

}

Consent

Use this consent resource as the base for authorization (post it to the server):

<Consent xmlns="http://hl7.org/fhir"> 
  <id value="1"/>
 <status value="active"/>
 <patient>
   <reference value="Patient/example"/>
 </patient>
 <policyRule value="http://hl7.org/fhir/ConsentDefinition/simple-oauth"/>  
 <except>  
   <type value="permit"/>
   <action>
     <coding>
       <system value="http://hl7.org/fhir/consentaction"/>
       
     </coding>
   </action>
   <class>
     <system value="http://smarthealthit.org/fhir/scopes"/>
      
   </class>
 </except> 
</Consent>

Authorization

This is what you post to the server as a body to the $authorize routine (this time in json):

{
 "resourceType" : "Parameters",
 "parameter" : [{
    "name" : "duration",
    "valueDuration" : {
      "value" : "3",
      "system" : "http://unitsofmeasure.org",
      "code" : "mo"
    }
  }, {
    "name" : "jwt",
    "valueString" : "{your packed JWT}"
  }  
 ]
}