Wednesday, October 23, 2019

Reporting on FHIR Structures

In yesterday's post, I mentioned that I had put together a report on FHIR resource use of code, Coding and CodeableConcept data types.  The stylesheet I used is provided below, and it was run over the profile-resources.xml file found in this download from the FHIR R4 website.

This is one of the truly valuable pieces of FHIR, that the specification itself is machine readable, which makes it possible to perform a variety of analyses and code generation tasks.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:f="http://hl7.org/fhir"
    exclude-result-prefixes="xs"
    version="1.0">
    <xsl:output method="text"/>
    <xsl:template match="/">
        <xsl:text>Name,Type,Binding,Cardinality&#xA;</xsl:text>
        <xsl:apply-templates select="//f:snapshot/f:element"></xsl:apply-templates>
    </xsl:template>
    <xsl:template match="f:snapshot/f:element">
        <xsl:if test="f:binding">
            <xsl:value-of select="@id"/>
            <xsl:text>,</xsl:text>
            <xsl:apply-templates select="." mode='type'/>
            <xsl:text>,</xsl:text>
            <xsl:value-of select="f:binding/f:strength/@value"/>
            <xsl:text>,</xsl:text>
            <xsl:value-of select="f:min/@value"/>
            <xsl:text>..</xsl:text>
            <xsl:value-of select="f:max/@value"/>
            <xsl:text>&#xA;</xsl:text>
        </xsl:if>
    </xsl:template>
    <xsl:template match="f:element" mode='type'>
        <xsl:choose>
            <xsl:when test='f:type/f:code[@value = "code"]'>code</xsl:when>
            <xsl:when test='f:type/f:code[@value = "Coding"]'>Coding</xsl:when>
            <xsl:when test='f:type/f:code[@value = "CodeableConcept"]'>CodeableConcept</xsl:when>
            <xsl:when test='f:type/f:code[@value = "string"]'>string</xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="f:type/f:code/@value"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
        
</xsl:stylesheet>

1 comment:

  1. There are some natural remedies that can be used in the prevention and eliminate diabetes totally. However, the single most important aspect of a diabetes control plan is adopting a wholesome life style Inner Peace, Nutritious and Healthy Diet, and Regular Physical Exercise. A state of inner peace and self-contentment is essential to enjoying a good physical health and over all well-being. The inner peace and self contentment is a just a state of mind.People with diabetes diseases often use complementary and alternative medicine. I diagnosed diabetes in 2000. Was at work feeling unusually tired and sleepy. I borrowed a glucometer from a co-worker and tested at 760. Went immediately to my doctor and he gave me prescibtion like: Insulin ,Sulfonylureas,Thiazolidinediones but Icould not get the cure rather to reduce the pain abd brink back the pain again. I found a woman testimony name Comfort online how Dr Akhigbe cure her HIV  and I aslo contacted the doctor and after I took his medication as instructed, I am now completely free from diabtes by doctor Akhigbe herbal medicine.So diabetes patients reading this testimony to contact his email     drrealakhigbe@gmail.com   or his Number   +2348142454860   He also use his herbal herbs to diseases like:SPIDER BITE, SCHIZOPHRENIA, LUPUS,EXTERNAL INFECTION, COMMON COLD, JOINT PAIN, EPILEPSY,STROKE,TUBERCULOSIS ,STOMACH DISEASE. ECZEMA, PROGERIA, EATING DISORDER, LOWER RESPIRATORY INFECTION,  DIABETICS,HERPES,HIV/AIDS, ;ALS,  CANCER , MENINGITIS,HEPATITIS A AND B,ASTHMA, HEART DISEASE, CHRONIC DISEASE. NAUSEA VOMITING OR DIARRHEA,KIDNEY DISEASE, WEAK ERECTION.,PAINFUL OR IRREGULAR MENSTRUATION.Dr Akhigbe is a good man and he heal any body that come to him. here is email    drrealakhigbe@gmail.com    and his Number +2348142454860.

    ReplyDelete