Coder Social home page Coder Social logo

Comments (3)

nir-r avatar nir-r commented on August 29, 2024
/*Analyse dateTime/Period/date/time elements https://github.com/users/nir-r/projects/1/views/1?pane=issue&itemId=66362143*/
/*List dateTime/Period/date/time elements in server-supported resources*/
(
  /*List all supported resources*/
   $SupportedResourceTypes := $capabilities().rest.resource[type in ['Patient','Practitioner','PractitionerRole','Observation','Encounter','Procedure']].type /*remove [] filtering on prod*/

  /*For each supported resource, list date/time/period elements*/
    ;$elements := $SupportedResourceTypes.$getSnapshot($).snapshot.element[type.code='dateTime' or type.code='date' or type.code='time' or type.code='Period'].{
      'resourceType': $substringBefore(path,".")
      ,'path': path
      ,'elementPath' : $substringAfter(path,$substringBefore(path,".") & '.')
      ,'id':id
      ,"dataType": type.code
      }

  /*Read sampled resources to memory*/
    ;$SampledResources := $readFile('SampledResources.json')

  /*Extract all values from date\time paths*/
    ;$DTvalues := $elements@$e.$SampledResources[$.resourceType=$e.resourceType].{
      'path':($e.path)
      ,'dataType':($e.dataType)
      ,'pathValue':$eval($e.elementPath)
      ,'id':$.id
      }
  
  /*Flatten the extracted values before loading to OLAP*/
  ;$DTvalues.{
    'path':path
    ,'dataType':dataType
    ,dataType='Period' ? {'pathValue.start':pathValue.start,'pathValue.end':pathValue.end} : 'pathValue':pathValue    
  }
)

from certificator.

nir-r avatar nir-r commented on August 29, 2024
/*Extract dateTime/Period/date/time elements from the sample and write to a target file by type*/
(
  $DateTimeElements := $readFile('DateTimeElements.json');

  $SampledResources := $readFile('SampledResources.json');

  $ElementsValues := $DateTimeElements@$dte.($SampledResources[resourceType=$dte.resourceType].(
      $instance := $;
      $value := $eval($dte.elementPath);
      $value#$i.{
      'resourceType': $instance.resourceType
      ,'id': $instance.id
      ,'path': $dte.path
      ,'dataType' : $dte.dataType
      ,'index': $i
      ,'value': $
      }
    ));
  
  $ElementsValues^(dataType,id,path,index)
)

from certificator.

nir-r avatar nir-r commented on August 29, 2024
/*Extract dateTime/Period/date/time elements from the sample and write to a target file by type*/
(
  $DateTimeElements := $readFile('DateTimeElements.json');

  $SampledResources := $readFile('SampledResources.json');

  $ElementsValues := $DateTimeElements@$dte.($SampledResources[resourceType=$dte.resourceType].{
    'resourceType': resourceType
    ,'id': id
    ,'path': $dte.path
    ,'dataType' : $dte.dataType
    ,'value': $eval($dte.elementPath)
    });
  
  $ElementsValues.value#$i.{
    'resourceType': %.resourceType
    ,'id': %.id
    ,'path': %.path
    ,'dataType' : %.dataType
    ,'index' : $i 
    ,'value': $
    }
)
```
/*Extract dateTime/Period/date/time elements from the sample and write to a target file by type*/
(
  $DateTimeElements := $readFile('DateTimeElements.json');

  $SampledResources := $readFile('SampledResources.json');

  $ElementsValues := $DateTimeElements@$dte.($SampledResources[resourceType=$dte.resourceType].{
    'resourceType': resourceType
    ,'id': id
    ,'path': $dte.path
    ,'dataType' : $dte.dataType
    ,'value': $eval($dte.elementPath)
    });
  
  $ElementsValues.value#$i.{
    'resourceType': %.resourceType
    ,'id': %.id
    ,'path': %.path
    ,'dataType' : %.dataType
    ,'index' : $i 
    ,'value': $
    }
)

from certificator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.