CDA API Guide

cda.code.simple

Sometimes the XML tag already implies the coding system that you are referring to. In these cases, the coding system is assumed and only the code is required.

These functions add/update “simple” codes used in your CDA document:

  • code.simple.add : Add a new code element that already implies its code system
  • code.simple.set : Update an existing code element that already implies its code system

simple.add() [top]

Usage: cda.code.simple.add{target=<{PARENT}>, element=<ELEMENT>, value=<DISPLAYNAME>}

Add a simple code element to your CDA document.

Note: Notice the absence of both the system and lookup parameters.

Returns:

  • A parsed tree representing the populated XML element

Required parameters:

  • target: The parent tag under which you wish to add the new element
  • element: The specific name of the tag you are creating
  • value: The coded value usually obtained from the relevant codeset table

Example:

cda.code.simple.add{target=P, element='languageCode', value=cda.codeset.language['English - US']}

Example Result:

<languageCode code="en-US"></languageCode>

simple.set() [top]

Usage: cda.code.set{target=<{ELEMENT}>, value=<DISPLAYNAME>}

Update an existing simple code element with the appropriate attributes.

Note: Notice the absence of both the system and lookup parameters.

Returns:

  • A parsed tree representing the populated XML element

Required parameters:

  • target: The XML element that you wish to update
  • value: The coded value usually obtained from the relevant codeset table

Example:
Note: In this example, we are updating an XML element named ‘CodeElement’.

cda.code.simple.set{target=CodeElement, value=cda.codeset.language['English - US']}

Example Result:

<languageCode code="en-US"></languageCode>

Leave A Comment?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.