use of org.hl7.v3.CD in project org.hl7.fhir.core by hapifhir.
the class LibraryRenderer method participantRow.
private void participantRow(XhtmlNode t, String label, ContactDetail cd, boolean email, boolean phone, boolean url) {
XhtmlNode tr = t.tr();
tr.td().tx(label);
tr.td().tx(cd.getName());
if (email) {
renderContactPoint(tr.td(), cd.getEmail());
}
if (phone) {
renderContactPoint(tr.td(), cd.getPhone());
}
if (url) {
renderContactPoint(tr.td(), cd.getUrl());
}
}
use of org.hl7.v3.CD in project org.hl7.fhir.core by hapifhir.
the class LibraryRenderer method render.
public boolean render(XhtmlNode x, Library lib) throws FHIRFormatError, DefinitionException, IOException {
if (lib.hasAuthor() || lib.hasEditor() || lib.hasReviewer() || lib.hasEndorser()) {
boolean email = hasCT(lib.getAuthor(), "email") || hasCT(lib.getEditor(), "email") || hasCT(lib.getReviewer(), "email") || hasCT(lib.getEndorser(), "email");
boolean phone = hasCT(lib.getAuthor(), "phone") || hasCT(lib.getEditor(), "phone") || hasCT(lib.getReviewer(), "phone") || hasCT(lib.getEndorser(), "phone");
boolean url = hasCT(lib.getAuthor(), "url") || hasCT(lib.getEditor(), "url") || hasCT(lib.getReviewer(), "url") || hasCT(lib.getEndorser(), "url");
x.h2().tx("Participants");
XhtmlNode t = x.table("grid");
for (ContactDetail cd : lib.getAuthor()) {
participantRow(t, "Author", cd, email, phone, url);
}
for (ContactDetail cd : lib.getEditor()) {
participantRow(t, "Editor", cd, email, phone, url);
}
for (ContactDetail cd : lib.getReviewer()) {
participantRow(t, "Reviewer", cd, email, phone, url);
}
for (ContactDetail cd : lib.getEndorser()) {
participantRow(t, "Endorser", cd, email, phone, url);
}
}
if (lib.hasRelatedArtifact()) {
x.h2().tx("Related Artifacts");
XhtmlNode t = x.table("grid");
boolean label = false;
boolean display = false;
boolean citation = false;
for (RelatedArtifact ra : lib.getRelatedArtifact()) {
label = label || ra.hasLabel();
display = display || ra.hasDisplay();
citation = citation || ra.hasCitation();
}
for (RelatedArtifact ra : lib.getRelatedArtifact()) {
renderArtifact(t, ra, lib, label, display, citation);
}
}
if (lib.hasParameter()) {
x.h2().tx("Parameters");
XhtmlNode t = x.table("grid");
boolean doco = false;
for (ParameterDefinition p : lib.getParameter()) {
doco = doco || p.hasDocumentation();
}
for (ParameterDefinition p : lib.getParameter()) {
renderParameter(t, p, doco);
}
}
if (lib.hasDataRequirement()) {
x.h2().tx("Data Requirements");
for (DataRequirement p : lib.getDataRequirement()) {
renderDataRequirement(x, p);
}
}
if (lib.hasContent()) {
x.h2().tx("Contents");
boolean isCql = false;
int counter = 0;
for (Attachment att : lib.getContent()) {
renderAttachment(x, att, isCql, counter, lib.getId());
isCql = isCql || (att.hasContentType() && att.getContentType().startsWith("text/cql"));
counter++;
}
}
return false;
}
use of org.hl7.v3.CD in project org.hl7.fhir.core by hapifhir.
the class XmlParserTests method testXsiDeserialiserXmlParser.
@Test
public /**
* Deserializes a simplified CDA example into the logical model and checks that
* xml deserialization works for the xsi:type
*
* @throws IOException
*/
void testXsiDeserialiserXmlParser() throws IOException {
Element cda = Manager.parseSingle(context, TestingUtilities.loadTestResourceStream("validator", "cda", "example-xsi.xml"), FhirFormat.XML);
ByteArrayOutputStream baosXml = new ByteArrayOutputStream();
Manager.compose(context, cda, baosXml, FhirFormat.XML, OutputStyle.PRETTY, null);
String cdaSerialised = baosXml.toString();
Assertions.assertTrue(cdaSerialised.indexOf("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"") > 0);
Assertions.assertTrue(cdaSerialised.indexOf("xsi:type=\"CD\"") > 0);
}
use of org.hl7.v3.CD in project org.hl7.fhir.core by hapifhir.
the class CapabilityStatementComparer method intersectCodeableConcepts.
private void intersectCodeableConcepts(List<CodeableConcept> tgt, List<CodeableConcept> src) {
List<CodeableConcept> toRemove = new ArrayList<CodeableConcept>();
for (CodeableConcept cd : src) {
boolean remove = false;
for (CodeableConcept t : tgt) {
if (t.matches(cd)) {
remove = true;
}
}
if (remove) {
toRemove.add(cd);
}
}
tgt.removeAll(toRemove);
}
use of org.hl7.v3.CD in project org.hl7.fhir.core by hapifhir.
the class CodeSystemComparer method intersect.
private ConceptDefinitionComponent intersect(ConceptDefinitionComponent l, ConceptDefinitionComponent r, CodeSystemComparison res) {
ConceptDefinitionComponent cd = l.copy();
if (l.hasDisplay() && !r.hasDisplay()) {
cd.setDisplay(null);
}
if (l.hasDefinition() && !r.hasDefinition()) {
cd.setDefinition(null);
}
intersectProps(cd, l, r, res);
// mergeDesignations(cd, l, r);
return cd;
}
Aggregations