The Geneva Document Generator

From MircWiki
Jump to: navigation, search

The Geneva application can create documents and transmit them to Repositories. The documents are created from XML templates. Each document has a unique template that includes both static content and references to information that is part of the registration which triggers the creation of the document. This article describes how to create templates.

Documents are CDA objects. All the files necessary to create a document must be contained in a directory unique to the document.

Documents may or may not contain Base64-encoded PDFs. The document generator creates the PDF from a file called pdfSource.xml in the document's directory. If the file is not present, no PDF is created. The pdfSource.xml file is transformed by the pdfSourceToFO.xsl program (located in the Geneva/docxsl directory). The result is a Formatting Objects XML document which is then transformed to a PDF.

The CDA is created from a file called cdaSource.xml, located in the document's directory. The cdaSource.xml file is transformed by the cdaSourceToCDA.xsl program (located in the Geneva/docxsl directory). The result is an XML document which is then transformed into the XML for transmission to the Repository.

Both the pdfSourceToFO.xsl program and the cdaSourceToCDA.xsl program are passed many parameters from the registration. Each program recognizes XML elements that insert the values of the parameters into the output object.

1 The pdfSourceToFO.xsl Program

Under construction.

2 The cdaSourceToCDA.xsl Program

The cdaSource.xml file must contain XML structured to produce the CDA document. Within the XML can be the following elements to insert content unique to the registration.

2.1 <xdsdemo:patientRole classCode="..." root="..."/>

This element produces a patientRole element in the output, encapsulating several fields from the registration. The result produced is:

<patientRole classCode="{value of the classCode attribute}">
    <id root="{value of the root attribute}"/>
    <addr>
        <streetAddressLine>{street address from registration}</streetAddressLine>
        <city>{city from registration}</city>
        <state>{state from registration}</state>
        <postalCode>{Zip code from registration}</postalCode>
        <country>{country from registration}</country>
    </addr>
    <patient>
        <name>
            <given>{given name from registration}</given>
            <family>{family name from registration}</family>
        </name>
        <administrativeGenderCode 
            codeSystem="2.16.840.1.113883.5.1"
            code="{sex from registration}"/>
        <birthTime value="{birth date from registration}"/>
    </patient>
</patientRole>

2.2 <xdsdemo:time-element name="..."/>

This element inserts an element with the name specified in the name attribute and a value attribute containing the date and time values supplied by the Geneva application. The time is always the current time, but the date is specified in the docset element and may be a specific date or an asterisk, in which case Geneva supplies the current date.

2.3 <xdsdemo:pdf/>

This element creates a text element to contain the Base64-encoded PDF. If no PDF was created, Geneva supplies an empty string. The format of the element produced is:

<text mediaType="application/pdf" representation="B64">
    {Base64-encoded PDF data}
</text>

2.4 <xdsdemo:uuid/>

This element inserts text in the output in the following form: urn:uuid:{uuid supplied by Geneva}.

2.5 <xdsdemo:patient-name/>

This element inserts the text of the patient's name from the registration.

2.6 <xdsdemo:full-name/>

This element inserts the text of the patient's name from the registration.

2.7 <xdsdemo:given-name/>

This element inserts the text of the patient's given name from the registration.

2.8 <xdsdemo:family-name/>

This element inserts the text of the patient's family name from the registration.

2.9 <xdsdemo:xdsdemo:patient-id/>

This element inserts the text of the patient's ID from the registration.

2.10 <xdsdemo:assigning-authority/>

This element inserts the text of the assigning authority supplied by Geneva (from the configuration).

2.11 <xdsdemo:institution-name/>

This element inserts the text of the institution name supplied by Geneva (from the configuration).

2.12 <xdsdemo:id document-id="..."/>

This element credates an id element in the form:

<id root="{value of the document-id attribute}"/>

2.13 <xdsdemo:document-id/>

This element inserts the text of the document ID supplied by Geneva.

2.14 <xdsdemo:title/>

This element inserts the text of the title supplied by Geneva. (This is typically the title of a PDF document.)

2.15 <xdsdemo:date/>

This element inserts the text of the date supplied by Geneva. The data is specified in the docset element. It and may be a specific date or an asterisk, in which case Geneva supplies the current date.

2.16 <xdsdemo:time/>

This element inserts the current time.

2.17 <xdsdemo:street/>

This element inserts the text of the street address from the registration.

2.18 <xdsdemo:city/>

This element inserts the text of the city from the registration.

2.19 <xdsdemo:state/>

This element inserts the text of the state from the registration.

2.20 <xdsdemo:zip/>

This element inserts the text of the zip code from the registration.

2.21 <xdsdemo:country/>

This element inserts the text of the country from the registration.

2.22 <xdsdemo:sex/>

This element inserts the text of the sex from the registration.

2.23 <xdsdemo:birth-date/>

This element inserts the text of the birth date from the registration.