Skip to content

Commit

Permalink
Add support for Cerner Sandbox R4 for Patient and Encounter
Browse files Browse the repository at this point in the history
  • Loading branch information
Kol Kheang committed Sep 21, 2019
1 parent 08d3c83 commit 1e04f19
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 15 deletions.
32 changes: 18 additions & 14 deletions App/EndpointProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,24 @@ public class EndpointProvider {
}

public func availableResourceTypes(for endpoint: Endpoint) -> [Resource.Type] {
return [
AllergyIntolerance.self,
CarePlan.self,
CareTeam.self,
Condition.self,
DiagnosticReport.self,
DocumentReference.self,
Goal.self,
Immunization.self,
MedicationRequest.self,
Observation.self,
Procedure.self,
ServiceRequest.self
]
// return [
// AllergyIntolerance.self,
// CarePlan.self,
// CareTeam.self,
// Condition.self,
// DiagnosticReport.self,
// DocumentReference.self,
// Goal.self,
// Immunization.self,
// MedicationRequest.self,
// Observation.self,
// Procedure.self,
// ServiceRequest.self
// ]
return [
Patient.self,
Encounter.self
]
}
}

Expand Down
3 changes: 2 additions & 1 deletion App/MasterViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ class MasterViewController: UITableViewController {
var i = 0
for resType in resourceTypes {
let ii = i
resType.type.search(["patient": patientId.string]).perform(smart.server) { bundle, error in
let searchParam = resType.type.resourceType == "Patient" ? ["_id": patientId.string] : ["patient": patientId.string];
resType.type.search(searchParam).perform(smart.server) { bundle, error in
if nil != error {
resType.error = error
}
Expand Down
13 changes: 13 additions & 0 deletions Endpoints.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ func configuredEndpoints() -> [Endpoint] {
fhirorg.authProperties.embedded = true
endpoints.append(Endpoint(client: fhirorg, name: "Test at FHIR.org"))

let cerner = LenientClient(
baseURL: URL(string: "https://fhir-ehr.sandboxcerner.com/r4/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca")!,
settings: [
"client_name": "Kol Standalone Provider Mobile App",
"client_id": "36d877eb-f4ae-484b-80a5-052b829adcfd",
"redirect": "smartapp://callback",
"scope": "openid profile online_access user/Patient.read user/Encounter.read",
"logo_uri": "https://avatars1.githubusercontent.com/u/7401080",
])
cerner.authProperties.granularity = .patientSelectNative
cerner.authProperties.embedded = true
endpoints.append(Endpoint(client: cerner, name: "Cerner Sandbox"))

return endpoints
}

0 comments on commit 1e04f19

Please sign in to comment.