pysmartdatamodels options in the tools menu

New options for pysmartdatamodels package. There are a new element in he tools menu to access the pysmartdatamodels package, its documentation, or a code example.

New service for customization of @context with official ontologies

Some of the data models available are generated according to some ontologies (like dataModels.OSLO). The @context provided for the subject includes IRIs with the smartdatamodels by default, however, the use of official ontologies can be required.

In order to allow this the file notes_context.jsonld was created and also included in the contribution manual (seection 1.5 slide 23).

Now the service for mapping the external ontologies (Home -> tools -> Mapper @context with external ontologies) can detect that instead of a regular configuration file a notes_context.jsonld is provided and applies the replacement of terms defined there.

It can be also used as an API call, in this link you have an example https://smartdatamodels.org/extra/create_external_referenced_context.php?localContext=https://raw.githubusercontent.com/smart-data-models/dataModel.OSLO/master/context.jsonld&configOntologies=https://raw.githubusercontent.com/smart-data-models/dataModel.OSLO/master/notes_context.jsonld

The structure of the notes_context.jsonld has to follow the template

  • {

“@context”: {

“Term1”: “uri_term_1”,

“Term2”: “uri_term_2”,

}

}

New version of pysmartdatamodels 0.5.41

There is a new version of the python package for smart data models  pysmartdatamodels 0.5.41

Changelog:

– The README include now the basic documentation of each function

  • New function to load in a dictionary all subjects and their data models, with their repository link, and related domains
  • New function to load in a dictionary all the attributes in every data model including  name of the property, data type, NGSI type, description, units, et

The data models available for python developers. pysmartdatamodels 0.5.40 published. Beta version.

Now you can find in pypi.org the python package pysmartdatamodels with 13 functions for the integrators of the data models (more than 800) in external systems and applications. It is a beta version. There is a function, update_data() that whenever is run, it updates the data models to the last version (including adding the new data models). The code is available at the utils directory.
This python package includes all the data models and several functions (listed below) to use in your developments.

If you want to be updated on this package you can join this mailing list (Announcements are sent only when something relevant happens). We love to get your feedback at info@smartdatamodels.org

There are several online tools to manage and to create the data models, generate examples or to adapt to existing ontologies. See the tools menu option at the home site.

Functions available include:

1- List all data models. Function list_all_datamodels()
2- List all subjects. Function list_all_subjects()
3- List the data models of a subject. Function datamodels_subject(subject)
4- List description of an attribute. Function description_attribute(subject, datamodel, attribute)
5- List data-type of an attribute. Function datatype_attribute(subject, datamodel, attribute)
6- Give reference model for an attribute. Function model_attribute(subject, datamodel, attribute)
7- Give reference units for an attribute. Function attributes_datamodel(subject, datamodel)
8- List the attributes of a data model. Function attributes_datamodel(subject, datamodel)
9- List the NGSI type (Property, Relationship or Geoproperty) of the attribute. Function ngsi_datatype_attribute(subject, datamodel, attribute)
10- Print a list of data models attributes separated by a separator. Function print_datamodel(subject, datamodel, separator, meta_attributes)
11- Returns the link to the repository of a subject. Function subject_repolink(subject)
12- Returns the links to the repositories of a data model name. Function datamodel_repolink(datamodel)
13- Update the official data model list or the database of attributes from the source. Function update_data()

Roadmap

1.- Create a proper documentation

2.- Function to allow submission of improvements (i.e. missing recommended units or model) and comments to the different data models. Currently, you can do it by searching for your data model here
https://smartdatamodels.org/index.php/list-of-data-models-3/ visiting the github repo and making your PR or raising your issues there.
3.- Function to submit a new data model to an incubation repository. Currently, this is done manually incubated repository. By filling this form you are granted to contribute with new data models.
4.- Include new functions like search for the subject of a data model or other that you can suggest to us at info@smartdatamodels.org

### some example code
from pysmartdatamodels import pysmartdatamodels as sdm
subject = "dataModel.Weather"
dataModel = "WeatherForecast"
attribute = "precipitation"
print(sdm.list_all_datamodels())
print(sdm.list_all_subjects())
print(sdm.datamodels_subject("dataModel.Weather"))
print(sdm.description_attribute(subject, dataModel, attribute))
print(sdm.datatype_attribute(subject, dataModel, attribute))
print(sdm.model_attribute(subject, dataModel, attribute))
print(sdm.units_attribute(subject, dataModel, attribute))
print(sdm.attributes_datamodel(subject, dataModel))
print(sdm.subject_repolink(subject))
print(sdm.datamodel_repolink(dataModel))
print(sdm.print_datamodel(subject, dataModel, ",", ["property", "type", "dataModel", "repoName", "description", "typeNGSI", "modelTags", "format", "units", "model"]))
sdm.update_data()

New data models MedicationAdministration and Claim

Happy new year the last two data models of 2022

See it in subject Hl7 in the Smart Health domain.

  • Claim. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.
  • MedicationAdministration. Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.

logo fhir

New data model Organization at Hl7 subject (Health)

There is a new data model for the subject Hl7, Organization for this health sector.

See it in subject Hl7 in the Smart Health domain.

  • Organization: A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc.

logo fhir

SQL export available for Postgresql

There is a new file ‘schema.sql‘ in all the directories of the data models. It is a SQL script for PostgreSQL.

The script creates the structure of a relational table containing the attributes defined in the data model. It also creates the data types for those attributes with an enumeration of values.

For those attributes being arrays or objects, it creates a JSON attribute (allowed in PostgreSQL).

If you need additional features in this export please report them to info@smartdatamodels.org.

See an example.

Postgresql elephant

Draft of a python package available

Now we have a draft version of a python package to integrate the smart data models with your developments. It is a beta version so you can expect some issues when using it. We will be glad if you report it at info@smartdatamodels.org or suggest new features. Thanks to Anthony Uphof for his contributions (only a few of them are in this draft, next version will include them)

To install

pip install -i test.pypi.org/simple/ pysmartdatamodels

The functions included are:

1- List all data models. Function list_all_datamodels()

2- List all subjects. Function list_all_subjects()

3- List the data models of a subject. Function datamodels_subject(subject)

4- List description of an attribute. Function description_attribute(subject, datamodel, attribute)

5- List data-type of an attribute. Function datatype_attribute(subject, datamodel, attribute)

6- Give reference model for an attribute. Function model_attribute(subject, datamodel, attribute)

7- Give reference units for an attribute. Function attributes_datamodel(subject, datamodel)

8- List the attributes of a data model. Function attributes_datamodel(subject, datamodel)

9- List the NGSI type (Property, Relationship or Geoproperty) of the attribute. Function ngsi_datatype_attribute(subject, datamodel, attribute)

11- Print a list of data models attributes separated by a separator. Function print_datamodel(subject, datamodel, separator, meta_attributes)

12- Update the official data model list or the database of attributes from the source. Function update_data()

New data models Citation and Immunization at Hl7 subject (Health)

In the subject, Hl7 is being progressively mapped

The following data models Citation and Immunization are mapped. In order to make it compatible with NGSI-LD some minor adjustments were necessary: 1) A limit in the recursive definition of data models has been applied (only 4 levels). 2) Modify the coding attribute to meet the examples.  3) Added the attribute type to be compatible with NGSI.

There are another 135 data models in the queue, and we hope they will be available soon. And other minor adjustments have been also included in the specification.

See it in subject Hl7 in the Smart Health domain.

  • Citation. The Citation Resource enables reference to any knowledge artifact for purposes of identification and attribution. The Citation Resource supports existing reference structures and developing publication practices such as versioning, expressing complex contributorship roles, and referencing computable resources.
  • Immunization. Describes the event of a patient being administered a vaccine or a record of immunization as reported by a patient, a clinician, or another party.

logo fhir

New data model Practitioner at HL7 subject (Health)

In the new subject, Hl7 is being progressively mapped

The following data model is the Practitioner data model. In order to make it compatible with NGSI-LD some minor adjustments were necessary: 1) A limit in the recursive definition of data models has been applied (only 4 levels). 2) Modify the coding attribute to meet the examples.  3) Added the attribute type to be compatible with NGSI.

There are another 137 data models in the queue, and we hope they will be available soon. And other minor adjustments have been also included in the specification.

See it in subject Hl7 in the Smart Health domain.

  • Practitioner. A person who is directly or indirectly involved in the provisioning of healthcare.

logo fhir