Skip to content

Commit

Permalink
Parsing the appointment-book request now working, including prefetch …
Browse files Browse the repository at this point in the history
…data. Still not getting cards back as results though, so needs more work.
  • Loading branch information
rgeimer committed Jan 16, 2024
1 parent eff9f42 commit ded035d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ public class CrdPrefetch {

@JsonSerialize(using = JacksonHapiSerializer.class)
@JsonDeserialize(using = JacksonIBaseResourceDeserializer.class)
private IBaseResource patientBundle;
private IBaseResource patient;

public IBaseResource getPatientBundle() {
return patientBundle;
public IBaseResource getPatient() {
return patient;
}

public void setPatientBundle(IBaseResource patientBundle) {
this.patientBundle = patientBundle;
public void setPatient(IBaseResource patient) {
this.patient = patient;
}

@JsonSerialize(using = JacksonHapiSerializer.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public Object getDataForPrefetchToken() {
contextMap.put("userId", getContext().getUserId());
contextMap.put("patientId", getContext().getPatientId());
contextMap.put("encounterId", getContext().getEncounterId());
contextMap.put("draftOrders", Utilities.bundleAsHashmap(getContext().getDraftOrders()));
// contextMap.put("draftOrders", Utilities.bundleAsHashmap(getContext().getDraftOrders()));
mapForPrefetchTemplates.put("context", contextMap);

return mapForPrefetchTemplates;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

import org.hl7.davinci.PrefetchTemplateElement;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.Patient;

/**
* Class that contains the different prefetch template elements used in crd requests.
* The templates are based on https://build.fhir.org/ig/HL7/davinci-crd/hooks.html#prefetch
*/
public class CrdPrefetchTemplateElements {

public static final PrefetchTemplateElement PATIENT_BUNDLE = new PrefetchTemplateElement(
"patientBundle",
Bundle.class,
public static final PrefetchTemplateElement PATIENT = new PrefetchTemplateElement(
"patient",
Patient.class,
"Patient/{{context.patientId}}");

public static final PrefetchTemplateElement COVERAGE_REQUEST_BUNDLE = new PrefetchTemplateElement(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class AppointmentBookService extends CdsService<AppointmentBookRequest>{
"Get information regarding the coverage requirements for appointments";
public static final List<PrefetchTemplateElement> PREFETCH_ELEMENTS = Arrays.asList(
CrdPrefetchTemplateElements.COVERAGE_REQUEST_BUNDLE,
CrdPrefetchTemplateElements.PATIENT_BUNDLE,
CrdPrefetchTemplateElements.PATIENT,
CrdPrefetchTemplateElements.ENCOUNTER_BUNDLE);
public static final FhirComponents FHIRCOMPONENTS = new FhirComponents();
public static final List<ConfigurationOption> CONFIGURATION_OPTIONS = Arrays.asList(
Expand Down

0 comments on commit ded035d

Please sign in to comment.