use of org.hl7.fhir.dstu3.model.ListResource in project org.hl7.fhir.core by hapifhir.
the class ListRenderer method render.
public boolean render(XhtmlNode x, ListResource list) throws FHIRFormatError, DefinitionException, IOException {
if (list.hasTitle()) {
x.h2().tx(list.getTitle());
}
XhtmlNode t = x.table("clstu");
XhtmlNode tr = t.tr();
if (list.hasDate()) {
tr.td().tx("Date: " + list.getDate().toLocaleString());
}
if (list.hasMode()) {
tr.td().tx("Mode: " + list.getMode().getDisplay());
}
if (list.hasStatus()) {
tr.td().tx("Status: " + list.getStatus().getDisplay());
}
if (list.hasCode()) {
tr.td().tx("Code: " + display(list.getCode()));
}
tr = t.tr();
if (list.hasSubject()) {
shortForRef(tr.td().txN("Subject: "), list.getSubject());
}
if (list.hasEncounter()) {
shortForRef(tr.td().txN("Encounter: "), list.getEncounter());
}
if (list.hasSource()) {
shortForRef(tr.td().txN("Source: "), list.getEncounter());
}
if (list.hasOrderedBy()) {
tr.td().tx("Order: " + display(list.getOrderedBy()));
}
for (Annotation a : list.getNote()) {
renderAnnotation(x, a);
}
boolean flag = false;
boolean deleted = false;
boolean date = false;
for (ListResourceEntryComponent e : list.getEntry()) {
flag = flag || e.hasFlag();
deleted = deleted || e.hasDeleted();
date = date || e.hasDate();
}
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 (ListResourceEntryComponent e : list.getEntry()) {
tr = t.tr();
shortForRef(tr.td(), e.getItem());
if (date) {
tr.td().tx(e.hasDate() ? e.getDate().toLocaleString() : "");
}
if (flag) {
tr.td().tx(e.hasFlag() ? display(e.getFlag()) : "");
}
if (deleted) {
tr.td().tx(e.hasDeleted() ? Boolean.toString(e.getDeleted()) : "");
}
}
return false;
}
use of org.hl7.fhir.dstu3.model.ListResource in project org.hl7.fhir.core by hapifhir.
the class ListRenderer method render.
public boolean render(XhtmlNode x, ListResource list) throws FHIRFormatError, DefinitionException, IOException {
if (list.hasTitle()) {
x.h2().tx(list.getTitle());
}
XhtmlNode t = x.table("clstu");
XhtmlNode tr = t.tr();
if (list.hasDate()) {
tr.td().tx("Date: " + list.getDate().toLocaleString());
}
if (list.hasMode()) {
tr.td().tx("Mode: " + list.getMode().getDisplay());
}
if (list.hasStatus()) {
tr.td().tx("Status: " + list.getStatus().getDisplay());
}
if (list.hasCode()) {
tr.td().tx("Code: " + display(list.getCode()));
}
tr = t.tr();
if (list.hasSubject()) {
shortForRef(tr.td().txN("Subject: "), list.getSubject());
}
if (list.hasEncounter()) {
shortForRef(tr.td().txN("Encounter: "), list.getEncounter());
}
if (list.hasSource()) {
shortForRef(tr.td().txN("Source: "), list.getEncounter());
}
if (list.hasOrderedBy()) {
tr.td().tx("Order: " + display(list.getOrderedBy()));
}
for (Annotation a : list.getNote()) {
renderAnnotation(x, a);
}
boolean flag = false;
boolean deleted = false;
boolean date = false;
for (ListResourceEntryComponent e : list.getEntry()) {
flag = flag || e.hasFlag();
deleted = deleted || e.hasDeleted();
date = date || e.hasDate();
}
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 (ListResourceEntryComponent e : list.getEntry()) {
tr = t.tr();
shortForRef(tr.td(), e.getItem());
if (date) {
tr.td().tx(e.hasDate() ? e.getDate().toLocaleString() : "");
}
if (flag) {
tr.td().tx(e.hasFlag() ? display(e.getFlag()) : "");
}
if (deleted) {
tr.td().tx(e.hasDeleted() ? Boolean.toString(e.getDeleted()) : "");
}
}
return false;
}
use of org.hl7.fhir.dstu3.model.ListResource in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ConsultationListMapper method mapToConsultation.
public ListResource mapToConsultation(RCMRMT030101UK04EhrExtract ehrExtract, Encounter encounter) {
ListResource consultation = new ListResource();
consultation.setStatus(ListStatus.CURRENT).setMode(ListMode.SNAPSHOT).setTitle(getConsultationTitle(encounter.getType())).setCode(CodeableConceptUtils.createCodeableConcept(CONSULTATION_CODE_CODE, LIST_CODE_SYSTEM, CONSULTATION_CODE_DISPLAY, null)).setSubject(encounter.getSubject()).setDateElement(getConsultationDate(encounter.getPeriod(), ehrExtract)).setOrderedBy(CodeableConceptUtils.createCodeableConcept(LIST_ORDERED_BY_CODE, LIST_ORDERED_BY_SYSTEM, LIST_ORDERED_BY_DISPLAY, null)).setEncounter(new Reference(encounter)).setMeta(generateMeta(LIST_META_PROFILE)).setId(getConsultationId(encounter.getId()));
return consultation;
}
use of org.hl7.fhir.dstu3.model.ListResource in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ConsultationListMapper method mapToTopic.
public ListResource mapToTopic(ListResource consultation, RCMRMT030101UK04CompoundStatement compoundStatement) {
ListResource topic = new ListResource();
topic.setStatus(ListStatus.CURRENT).setMode(ListMode.SNAPSHOT).setTitle(getTitle(compoundStatement)).setCode(CodeableConceptUtils.createCodeableConcept(TOPIC_CODE_CODE, LIST_CODE_SYSTEM, TOPIC_CODE_DISPLAY, null)).setEncounter(consultation.getEncounter()).setSubject(consultation.getSubject()).setDateElement(getDate(compoundStatement, consultation)).setOrderedBy(CodeableConceptUtils.createCodeableConcept(LIST_ORDERED_BY_CODE, LIST_ORDERED_BY_SYSTEM, LIST_ORDERED_BY_DISPLAY, null)).setMeta(generateMeta(LIST_META_PROFILE)).setId(getTopicId(compoundStatement));
return topic;
}
use of org.hl7.fhir.dstu3.model.ListResource in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ConsultationListMapper method mapToCategory.
public ListResource mapToCategory(ListResource topic, RCMRMT030101UK04CompoundStatement compoundStatement) {
ListResource category = new ListResource();
category.setStatus(ListStatus.CURRENT).setMode(ListMode.SNAPSHOT).setTitle(getTitle(compoundStatement)).setCode(CodeableConceptUtils.createCodeableConcept(CATEGORY_CODE_CODE, LIST_CODE_SYSTEM, CATEGORY_CODE_DISPLAY, null)).setEncounter(topic.getEncounter()).setSubject(topic.getSubject()).setDateElement(getDate(compoundStatement, topic)).setOrderedBy(CodeableConceptUtils.createCodeableConcept(LIST_ORDERED_BY_CODE, LIST_ORDERED_BY_SYSTEM, LIST_ORDERED_BY_DISPLAY, null)).setMeta(generateMeta(LIST_META_PROFILE)).setId(compoundStatement.getId().get(0).getRoot());
return category;
}
Aggregations