use of org.hl7.fhir.dstu3.model.HealthcareService in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composePractitionerPractitionerPractitionerRoleComponent.
protected void composePractitionerPractitionerPractitionerRoleComponent(Complex parent, String parentType, String name, Practitioner.PractitionerPractitionerRoleComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "practitionerRole", name, element, index);
if (element.hasOrganization())
composeReference(t, "Practitioner", "organization", element.getOrganization(), -1);
if (element.hasRole())
composeCodeableConcept(t, "Practitioner", "role", element.getRole(), -1);
for (int i = 0; i < element.getSpecialty().size(); i++) composeCodeableConcept(t, "Practitioner", "specialty", element.getSpecialty().get(i), i);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Practitioner", "identifier", element.getIdentifier().get(i), i);
for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "Practitioner", "telecom", element.getTelecom().get(i), i);
if (element.hasPeriod())
composePeriod(t, "Practitioner", "period", element.getPeriod(), -1);
for (int i = 0; i < element.getLocation().size(); i++) composeReference(t, "Practitioner", "location", element.getLocation().get(i), i);
for (int i = 0; i < element.getHealthcareService().size(); i++) composeReference(t, "Practitioner", "healthcareService", element.getHealthcareService().get(i), i);
}
use of org.hl7.fhir.dstu3.model.HealthcareService in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composePractitionerRole.
protected void composePractitionerRole(Complex parent, String parentType, String name, PractitionerRole element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "PractitionerRole", name, element, index);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "PractitionerRole", "identifier", element.getIdentifier().get(i), i);
if (element.hasActiveElement())
composeBoolean(t, "PractitionerRole", "active", element.getActiveElement(), -1);
if (element.hasPeriod())
composePeriod(t, "PractitionerRole", "period", element.getPeriod(), -1);
if (element.hasPractitioner())
composeReference(t, "PractitionerRole", "practitioner", element.getPractitioner(), -1);
if (element.hasOrganization())
composeReference(t, "PractitionerRole", "organization", element.getOrganization(), -1);
for (int i = 0; i < element.getCode().size(); i++) composeCodeableConcept(t, "PractitionerRole", "code", element.getCode().get(i), i);
for (int i = 0; i < element.getSpecialty().size(); i++) composeCodeableConcept(t, "PractitionerRole", "specialty", element.getSpecialty().get(i), i);
for (int i = 0; i < element.getLocation().size(); i++) composeReference(t, "PractitionerRole", "location", element.getLocation().get(i), i);
for (int i = 0; i < element.getHealthcareService().size(); i++) composeReference(t, "PractitionerRole", "healthcareService", element.getHealthcareService().get(i), i);
for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "PractitionerRole", "telecom", element.getTelecom().get(i), i);
for (int i = 0; i < element.getAvailableTime().size(); i++) composePractitionerRolePractitionerRoleAvailableTimeComponent(t, "PractitionerRole", "availableTime", element.getAvailableTime().get(i), i);
for (int i = 0; i < element.getNotAvailable().size(); i++) composePractitionerRolePractitionerRoleNotAvailableComponent(t, "PractitionerRole", "notAvailable", element.getNotAvailable().get(i), i);
if (element.hasAvailabilityExceptionsElement())
composeString(t, "PractitionerRole", "availabilityExceptions", element.getAvailabilityExceptionsElement(), -1);
for (int i = 0; i < element.getEndpoint().size(); i++) composeReference(t, "PractitionerRole", "endpoint", element.getEndpoint().get(i), i);
}
use of org.hl7.fhir.dstu3.model.HealthcareService in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composePractitionerRole.
protected void composePractitionerRole(Complex parent, String parentType, String name, PractitionerRole element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "PractitionerRole", name, element, index);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "PractitionerRole", "identifier", element.getIdentifier().get(i), i);
if (element.hasActiveElement())
composeBoolean(t, "PractitionerRole", "active", element.getActiveElement(), -1);
if (element.hasPeriod())
composePeriod(t, "PractitionerRole", "period", element.getPeriod(), -1);
if (element.hasPractitioner())
composeReference(t, "PractitionerRole", "practitioner", element.getPractitioner(), -1);
if (element.hasOrganization())
composeReference(t, "PractitionerRole", "organization", element.getOrganization(), -1);
for (int i = 0; i < element.getCode().size(); i++) composeCodeableConcept(t, "PractitionerRole", "code", element.getCode().get(i), i);
for (int i = 0; i < element.getSpecialty().size(); i++) composeCodeableConcept(t, "PractitionerRole", "specialty", element.getSpecialty().get(i), i);
for (int i = 0; i < element.getLocation().size(); i++) composeReference(t, "PractitionerRole", "location", element.getLocation().get(i), i);
for (int i = 0; i < element.getHealthcareService().size(); i++) composeReference(t, "PractitionerRole", "healthcareService", element.getHealthcareService().get(i), i);
for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "PractitionerRole", "telecom", element.getTelecom().get(i), i);
for (int i = 0; i < element.getAvailableTime().size(); i++) composePractitionerRolePractitionerRoleAvailableTimeComponent(t, "PractitionerRole", "availableTime", element.getAvailableTime().get(i), i);
for (int i = 0; i < element.getNotAvailable().size(); i++) composePractitionerRolePractitionerRoleNotAvailableComponent(t, "PractitionerRole", "notAvailable", element.getNotAvailable().get(i), i);
if (element.hasAvailabilityExceptionsElement())
composeString(t, "PractitionerRole", "availabilityExceptions", element.getAvailabilityExceptionsElement(), -1);
for (int i = 0; i < element.getEndpoint().size(); i++) composeReference(t, "PractitionerRole", "endpoint", element.getEndpoint().get(i), i);
}
use of org.hl7.fhir.dstu3.model.HealthcareService in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeHealthcareServiceHealthcareServiceEligibilityComponent.
protected void composeHealthcareServiceHealthcareServiceEligibilityComponent(Complex parent, String parentType, String name, HealthcareService.HealthcareServiceEligibilityComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "eligibility", name, element, index);
if (element.hasCode())
composeCodeableConcept(t, "HealthcareService", "code", element.getCode(), -1);
if (element.hasCommentElement())
composeMarkdown(t, "HealthcareService", "comment", element.getCommentElement(), -1);
}
use of org.hl7.fhir.dstu3.model.HealthcareService in project CRD by HL7-DaVinci.
the class CoverageRequirementsDiscoveryOperationHardCodedResponse method coverageRequirementsDiscovery.
/**
* Submits the CRD request.
* @param request the request to be submitted
* @param endpoint the endpoint to submit the request to
* @param requestQualification what kind of request it is
* @return the parameters returned from the server
*/
@Operation(name = "$coverage-requirements-discovery", idempotent = true)
public Parameters coverageRequirementsDiscovery(@OperationParam(name = "request") Parameters.ParametersParameterComponent request, @OperationParam(name = "endpoint") Endpoint endpoint, @OperationParam(name = "requestQualification") CodeableConcept requestQualification) {
logger.debug("coverageRequirementsDiscovery: start");
Parameters retVal = new Parameters();
CoverageEligibilityRequest eligibilityRequest = null;
Patient patient = null;
Coverage coverage = null;
Practitioner provider = null;
Organization insurer = null;
Location facility = null;
// supportingInformation
// serviceInformation
// grab the list of parameters
List<Parameters.ParametersParameterComponent> paramList = request.getPart();
// pull each of the parameters from the list
for (Parameters.ParametersParameterComponent part : paramList) {
System.out.println(part.getName());
switch(part.getName()) {
case "eligibilityrequest":
logger.debug("CRD: got eligibilityrequest");
eligibilityRequest = (CoverageEligibilityRequest) part.getResource();
break;
case "patient":
logger.debug("CRD: got patient");
patient = (Patient) part.getResource();
break;
case "coverage":
logger.debug("CRD: got coverage");
coverage = (Coverage) part.getResource();
break;
case "provider":
logger.debug("CRD: got provider");
provider = (Practitioner) part.getResource();
break;
case "insurer":
logger.debug("CRD: got insurer");
insurer = (Organization) part.getResource();
break;
case "facility":
logger.debug("CRD: got facility");
facility = (Location) part.getResource();
break;
case "patientContext":
ResourceType patientContextType = part.getResource().getResourceType();
switch(patientContextType) {
case Condition:
logger.debug("CRD: got request.patientContext of type Condition");
break;
case Device:
logger.debug("CRD: got request.patientContext of type Device");
break;
case Procedure:
logger.debug("CRD: got request.patientContext of type Procedure");
break;
case MedicationStatement:
logger.debug("CRD: got request.patientContext of type MedicationStatement");
break;
case HealthcareService:
logger.debug("CRD: got request.patientContext of type HealthcareService");
break;
default:
logger.warn("Warning: unexpected request.patientContext type");
break;
}
break;
case "serviceInformationReference":
ResourceType serviceInformationReferenceType = part.getResource().getResourceType();
switch(serviceInformationReferenceType) {
case Procedure:
logger.debug("CRD: got request.serviceInformationReferenceType of type Procedure");
break;
case HealthcareService:
logger.debug("CRD: got request.serviceInformationReferenceType " + "of type HealthcareService");
break;
case ServiceRequest:
logger.debug("CRD: got request.serviceInformationReferenceType " + "of type ServiceRequest");
break;
case MedicationRequest:
logger.debug("CRD: got request.serviceInformationReferenceType " + "of type MedicationRequest");
break;
case Medication:
logger.debug("CRD: got request.serviceInformationReferenceType of type Medication");
break;
case Device:
logger.debug("CRD: got request.serviceInformationReferenceType of type Device");
break;
case DeviceRequest:
logger.debug("CRD: got request.serviceInformationReferenceType " + "of type DeviceRequest");
break;
default:
logger.warn("Warning: unexpected request.serviceInformationReferenceType type");
break;
}
break;
default:
logger.warn("Warning: unexpected parameter part: " + part.getName());
break;
}
}
// Note: if nothing is set in the reference (even if it was created) it will be null
if (nullCheck(eligibilityRequest, "eligibilityrequest") || nullCheck(patient, "patient") || nullCheck(coverage, "coverage") || nullCheck(provider, "provider") || nullCheck(insurer, "insurer")) {
logger.error("ERROR: required information missing!");
return retVal;
}
// print out the patient name
assert patient != null;
if (patient.hasName()) {
logger.debug("CRD: Patient Name: " + patient.getName().get(0).getText());
} else {
logger.debug("CRD: No Patient Name provided");
}
// start building the response
CoverageEligibilityResponse eligibilityResponse = new CoverageEligibilityResponse();
eligibilityResponse.setDisposition("this is a test");
Endpoint finalEndPoint = new Endpoint();
finalEndPoint.setAddress("http://www.mitre.org");
Parameters.ParametersParameterComponent response = retVal.addParameter();
response.setName("response");
response.addPart().setName("eligibilityresponse").setResource(eligibilityResponse);
response.addPart().setName("requestProvider").setResource(provider);
response.addPart().setName("request").setResource(eligibilityRequest);
response.addPart().setName("insurer").setResource(insurer);
response.addPart().setName("coverage").setResource(coverage);
// add a few service resources to the parameters
Procedure procedure = new Procedure();
procedure.setId("procedure-1");
Device device = new Device();
device.setModelNumber("LMNOP678");
response.addPart().setName("service").setResource(procedure);
response.addPart().setName("service").setResource(device);
if (finalEndPoint != null) {
response.addPart().setName("endPoint").setResource(finalEndPoint);
}
logger.debug("coverageRequirementsDiscovery: end");
return retVal;
}
Aggregations