use of org.hl7.fhir.utilities.graphql.Operation in project beneficiary-fhir-data by CMSgov.
the class EndpointJsonResponseComparatorV2IT method eobReadDme.
/**
* @return the results of the {@link
* ExplanationOfBenefitResourceProvider#read(org.hl7.fhir.dstu3.model.IdType)} operation for
* DME claims
*/
public static String eobReadDme() {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
IGenericClient fhirClient = createFhirClientAndSetEncoding();
JsonInterceptor jsonInterceptor = createAndRegisterJsonInterceptor(fhirClient);
DMEClaim dmeClaim = loadedRecords.stream().filter(r -> r instanceof DMEClaim).map(r -> (DMEClaim) r).findFirst().get();
fhirClient.read().resource(ExplanationOfBenefit.class).withId(TransformerUtilsV2.buildEobId(ClaimTypeV2.DME, dmeClaim.getClaimId())).execute();
return jsonInterceptor.getResponse();
}
use of org.hl7.fhir.utilities.graphql.Operation in project beneficiary-fhir-data by CMSgov.
the class EndpointJsonResponseComparatorV2IT method patientByIdentifier.
/**
* @return the results of the {@link
* R4PatientResourceProvider#searchByIdentifier(ca.uhn.fhir.rest.param.TokenParam)} operation
*/
public static String patientByIdentifier() {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
Beneficiary beneficiary = loadedRecords.stream().filter(r -> r instanceof Beneficiary).map(r -> (Beneficiary) r).findFirst().get();
IGenericClient fhirClient = createFhirClientAndSetEncoding();
JsonInterceptor jsonInterceptor = createAndRegisterJsonInterceptor(fhirClient);
fhirClient.search().forResource(Patient.class).where(Patient.IDENTIFIER.exactly().systemAndIdentifier(TransformerConstants.CODING_BBAPI_BENE_HICN_HASH, beneficiary.getHicn())).returnBundle(Bundle.class).execute();
return sortPatientIdentifiers(jsonInterceptor.getResponse());
}
use of org.hl7.fhir.utilities.graphql.Operation in project beneficiary-fhir-data by CMSgov.
the class EndpointJsonResponseComparatorV2IT method patientSearchByIdWithIncludeIdentifiers.
/**
* @return the results of the {@link
* R4PatientResourceProvider#searchByLogicalId(ca.uhn.fhir.rest.param.TokenParam)} operation
* when {@link ExtraParamsInterceptor#setIncludeIdentifiers(IncludeIdentifiersValues)} set to
* "hicn, mbi"
*/
public static String patientSearchByIdWithIncludeIdentifiers() {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
Beneficiary beneficiary = loadedRecords.stream().filter(r -> r instanceof Beneficiary).map(r -> (Beneficiary) r).findFirst().get();
IGenericClient fhirClient = createFhirClientAndSetEncoding();
ExtraParamsInterceptor extraParamsInterceptor = new ExtraParamsInterceptor();
extraParamsInterceptor.setHeaders(RequestHeaders.getHeaderWrapper(R4PatientResourceProvider.HEADER_NAME_INCLUDE_IDENTIFIERS, "hicn,mbi", R4PatientResourceProvider.HEADER_NAME_INCLUDE_ADDRESS_FIELDS, "true"));
fhirClient.registerInterceptor(extraParamsInterceptor);
JsonInterceptor jsonInterceptor = createAndRegisterJsonInterceptor(fhirClient);
fhirClient.search().forResource(Patient.class).where(Patient.RES_ID.exactly().systemAndIdentifier(null, beneficiary.getBeneficiaryId())).returnBundle(Bundle.class).execute();
return sortPatientIdentifiers(jsonInterceptor.getResponse());
}
use of org.hl7.fhir.utilities.graphql.Operation in project beneficiary-fhir-data by CMSgov.
the class EndpointJsonResponseComparatorV2IT method eobByPatientIdPaged.
/**
* @return the results of the paged {@link
* ExplanationOfBenefitResourceProvider#findByPatient(ca.uhn.fhir.rest.param.ReferenceParam,
* String, ca.uhn.fhir.rest.method.RequestDetails)} operation
*/
public static String eobByPatientIdPaged() {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
Beneficiary beneficiary = loadedRecords.stream().filter(r -> r instanceof Beneficiary).map(r -> (Beneficiary) r).findFirst().get();
IGenericClient fhirClient = createFhirClientAndSetEncoding();
JsonInterceptor jsonInterceptor = createAndRegisterJsonInterceptor(fhirClient);
fhirClient.search().forResource(ExplanationOfBenefit.class).where(ExplanationOfBenefit.PATIENT.hasId(TransformerUtilsV2.buildPatientId(beneficiary))).count(8).returnBundle(Bundle.class).execute();
return sortDiagnosisTypes(jsonInterceptor.getResponse(), "/entry/3/resource/diagnosis/7/type");
}
use of org.hl7.fhir.utilities.graphql.Operation in project beneficiary-fhir-data by CMSgov.
the class EndpointJsonResponseComparatorV2IT method eobReadCarrier.
/**
* @return the results of the {@link
* ExplanationOfBenefitResourceProvider#read(org.hl7.fhir.dstu3.model.IdType)} operation for
* Carrier claims
*/
public static String eobReadCarrier() {
List<Object> loadedRecords = ServerTestUtils.get().loadData(Arrays.asList(StaticRifResourceGroup.SAMPLE_A.getResources()));
IGenericClient fhirClient = createFhirClientAndSetEncoding();
JsonInterceptor jsonInterceptor = createAndRegisterJsonInterceptor(fhirClient);
CarrierClaim carrClaim = loadedRecords.stream().filter(r -> r instanceof CarrierClaim).map(r -> (CarrierClaim) r).findFirst().get();
fhirClient.read().resource(ExplanationOfBenefit.class).withId(TransformerUtilsV2.buildEobId(ClaimTypeV2.CARRIER, carrClaim.getClaimId())).execute();
return jsonInterceptor.getResponse();
}
Aggregations