Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Writing some code

So lets write our first GELLO code that GELLt simply will be querying a patients gender.

GELLO can be used in different contexts. Here we will be looking at a single patient at a time. So in the workspace say:

          Context SinglePatient

and hit the Compile button

 

 

 

button Image Added

What happens? Yes there should be a couple of error messages in a new bottom-most pane. The first message is saying it has no idea what you are talking about with the word "SinglePatient"and wants us to specify the model package that can define it. The best way to do this is to get in the habit of adding a line now above the one we have that says

          imports HL7_v2_VMR_V1

Compile that and we are left with the other error message that says in effect we have said what we want the code to give us (GELLO is declarative). That's ok for now and this error does not stop things from working.

So what we want is the gender of the patient.

Below this put in a a blank line and then type:

          patient.

and pause - Code autocomplete will give us some hints:

Image Added

 

Choose the gender attribute. [Notice anything else about the code in general in this screenshot ? - yes,  we can collapse the top two lines into one single line that specifies the imported package and the context.]

Now compile - all good. Ok we choose the Run button Image Added. [ NB - Not the one on the left of this that we can use to step through the code for debugging - on step at a time). The normal procedure is to compile code so that's its syntactically correct, then run it against some test clinical data.

 Ok it wants some test data. Here is a small xml file for us to get started with. Either cut and past the following text into notepad or notepad++ and save as firstTest.xml or download it here. Then when we run the GELLO code, navigate to where you have this file.

 

<?xml version="1.0" encoding="UTF-8"?>

<singlePatient     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:noNamespaceSchemaLocation="./iso-21090-datatypes.xsd">

    <patient>

        <!-- Patient ID uses an Australian Medicare Card ID-->

        <patientID

            root="1.2.36.174030967"

            extension="1234567892"

            reliability="VRF"

            scope="OBJ"/>

        <patientName>

            <part type="GIV" value="Alice" />

            <part type="GIV" value="A." />

            <part type="FAM" value="Someone" />

        </patientName>

        <dob value="19550621"/>

        <gender code="248152002"

            codeSystem="2.16.840.1.113883.6.96"

            codeSystemName="SNOMED-CT">

            <displayName value = "Female" />

        </gender>

        <ssn value="987-65-4320"/>

        <address use="WP">

            <part type="AL" value="1050 W Wishard Blvd" />

            <part type="CTY" value="Indianapolis" />

            <part type="STA" value="IN" />

            <part type="ZIP" value="46240" />

        </address>

    </patient>

</singlePatient>

 

And here is the result - we are looking at top RHS of the editor screen:

Image Added

 

That's it for the first tutorial - well done!

 Next time we will write more GELLO code using the date of birth; see how to set some test data in place for a GELLO editing session, and introduce the implies method to check for an allergy.