use of org.hl7.fhir.dstu2016may.model.Annotation in project org.hl7.fhir.core by hapifhir.
the class ListRenderer method render.
public boolean render(XhtmlNode x, ResourceWrapper list) throws FHIRFormatError, DefinitionException, IOException {
if (list.has("title")) {
x.h2().tx(list.get("title").primitiveValue());
}
XhtmlNode t = x.table("clstu");
XhtmlNode tr = t.tr();
XhtmlNode td = tr.td();
if (list.has("date")) {
td.tx("Date: " + list.get("date").dateTimeValue().toHumanDisplay());
}
if (list.has("mode")) {
td.tx("Mode: " + list.get("mode").primitiveValue());
}
if (list.has("status")) {
td.tx("Status: " + list.get("status").primitiveValue());
}
if (list.has("code")) {
td.tx("Code: " + displayBase(list.get("code")));
}
tr = t.tr();
td = tr.td();
if (list.has("subject")) {
td.tx("Subject: ");
shortForRef(td, list.get("subject"));
}
if (list.has("encounter")) {
td.tx("Encounter: ");
shortForRef(td, list.get("encounter"));
}
if (list.has("source")) {
td.tx("Source: ");
shortForRef(td, list.get("encounter"));
}
if (list.has("orderedBy")) {
td.tx("Order: " + displayBase(list.get("orderedBy")));
}
// for (Annotation a : list.getNote()) {
// renderAnnotation(a, x);
// }
boolean flag = false;
boolean deleted = false;
boolean date = false;
for (BaseWrapper e : list.children("entry")) {
flag = flag || e.has("flag");
deleted = deleted || e.has("deleted");
date = date || e.has("date");
}
t = x.table("grid");
tr = t.tr().style("backgound-color: #eeeeee");
tr.td().b().tx("Items");
if (date) {
tr.td().tx("Date");
}
if (flag) {
tr.td().tx("Flag");
}
if (deleted) {
tr.td().tx("Deleted");
}
for (BaseWrapper e : list.children("entry")) {
tr = t.tr();
shortForRef(tr.td(), e.get("item"));
if (date) {
tr.td().tx(e.has("date") ? e.get("date").dateTimeValue().toHumanDisplay() : "");
}
if (flag) {
tr.td().tx(e.has("flag") ? displayBase(e.get("flag")) : "");
}
if (deleted) {
tr.td().tx(e.has("deleted") ? e.get("deleted").primitiveValue() : "");
}
}
return false;
}
use of org.hl7.fhir.dstu2016may.model.Annotation in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ConditionMapper method buildNotes.
private List<Annotation> buildNotes(Optional<RCMRMT030101UK04ObservationStatement> observationStatement, RCMRMT030101UK04LinkSet linkSet) {
List<Annotation> annotationList = new ArrayList<>();
observationStatement.ifPresent(observationStatement1 -> observationStatement1.getPertinentInformation().stream().map(RCMRMT030101UK04PertinentInformation02::getPertinentAnnotation).filter(Objects::nonNull).map(RCMRMT030101UK04Annotation::getText).filter(StringUtils::isNotBlank).map(StringType::new).map(Annotation::new).forEach(annotationList::add));
if (linkSet.hasCode() && linkSet.getCode().getOriginalText() != null) {
StringType text = new StringType(linkSet.getCode().getOriginalText());
annotationList.add(new Annotation(text));
}
return annotationList;
}
use of org.hl7.fhir.dstu2016may.model.Annotation in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ConditionMapper method getCondition.
private Condition getCondition(RCMRMT030101UK04EhrExtract ehrExtract, Patient patient, List<Encounter> encounters, RCMRMT030101UK04EhrComposition composition, RCMRMT030101UK04LinkSet linkSet, String practiseCode) {
String id = linkSet.getId().getRoot();
Condition condition = (Condition) new Condition().addIdentifier(buildIdentifier(id, practiseCode)).addCategory(generateCategory()).setId(id).setMeta(generateMeta(META_PROFILE));
buildClinicalStatus(linkSet.getCode()).ifPresentOrElse(condition::setClinicalStatus, () -> {
condition.setClinicalStatus(ACTIVE);
condition.addNote(new Annotation(new StringType(DEFAULT_CLINICAL_STATUS)));
});
condition.setSubject(new Reference(patient));
condition.addExtension(buildProblemSignificance(linkSet.getCode()));
generateAnnotationToMinor(linkSet.getCode()).ifPresent(condition::addNote);
buildContext(composition, encounters).ifPresent(condition::setContext);
buildOnsetDateTimeType(linkSet).ifPresent(condition::setOnset);
buildAbatementDateTimeType(linkSet.getEffectiveTime()).ifPresent(condition::setAbatement);
buildAssertedDateTimeType(composition).ifPresentOrElse(condition::setAssertedDateElement, () -> condition.setAssertedDateElement(parseToDateTimeType(ehrExtract.getAvailabilityTime().getValue())));
composition.getParticipant2().stream().findFirst().ifPresent(participant2 -> condition.setAsserter(new Reference(new IdType(ResourceType.Practitioner.name(), participant2.getAgentRef().getId().getRoot()))));
return condition;
}
use of org.hl7.fhir.dstu2016may.model.Annotation in project CRD by HL7-DaVinci.
the class CardBuilder method priorAuthCard.
public static Card priorAuthCard(CqlResultsForCard cqlResults, IBaseResource request, FhirComponentsT fhirComponents, String priorAuthId, String patientId, String payerId, String providerId, String applicationFhirPath, FhirResourceRepository fhirResourceRepository) {
logger.info("Build Prior Auth Card");
Card card = transform(CardTypes.PRIOR_AUTH, cqlResults, false);
// create the ClaimResponse
ClaimResponse claimResponse = Utilities.createClaimResponse(priorAuthId, patientId, payerId, providerId, applicationFhirPath);
// build the FhirResource and save to the database
FhirResource fhirResource = new FhirResource();
fhirResource.setFhirVersion(fhirComponents.getFhirVersion().toString()).setResourceType(claimResponse.fhirType()).setData(fhirComponents.getJsonParser().encodeResourceToString(claimResponse));
fhirResource.setId(claimResponse.getId());
fhirResource.setName(claimResponse.getId());
FhirResource newFhirResource = fhirResourceRepository.save(fhirResource);
logger.info("stored: " + newFhirResource.getFhirVersion() + "/" + newFhirResource.getResourceType() + "/" + newFhirResource.getId());
// create the reference to the ClaimResponse
Reference claimResponseReference = new Reference();
claimResponseReference.setReference("ClaimResponse/" + claimResponse.getId());
// add SupportingInfo to the Request
IBaseResource outputRequest = FhirRequestProcessor.addSupportingInfoToRequest(request, claimResponseReference);
// add suggestion with ClaimResponse
Suggestion suggestionWithClaimResponse = createSuggestionWithResource(outputRequest, claimResponse, fhirComponents, "Store the prior authorization in the EHR", true);
card.addSuggestionsItem(suggestionWithClaimResponse);
// add suggestion with annotation
Suggestion suggestionWithAnnotation = createSuggestionWithNote(card, outputRequest, fhirComponents, "Store prior authorization as an annotation to the order", "Add authorization to record", false, CoverageGuidance.PRIOR_AUTH);
card.addSuggestionsItem(suggestionWithAnnotation);
card.setSelectionBehavior(Card.SelectionBehaviorEnum.AT_MOST_ONE);
return card;
}
Aggregations