Indivo Data Model: Problem

Model Definition

As SDML:

{
    "__modelname__": "Problem",
    "startDate": "Date",
    "endDate": "Date",
    "name": "CodedValue",
    "notes": "String"
}

As a Django Model Class:

from indivo.models import Fact
from indivo.fields import CodedValueField
from django.db import models

class Problem(Fact):
  startDate = models.DateTimeField(null=True)
  endDate = models.DateTimeField(null=True)
  name = CodedValueField()
  notes = models.TextField(null=True)

Examples

As SDMJ:

{
    "__modelname__": "Problem",
    "startDate": "2009-05-16T12:00:00Z",
    "endDate": "2009-05-16T16:00:00Z",
    "name_title": "Backache (finding)",
    "name_system": "http://purl.bioontology.org/ontology/SNOMEDCT/",
    "name_identifier": "161891005"
}

As SDMX:

<Models>
  <Model name="Problem">
    <Field name="startDate">2009-05-16T12:00:00Z</Field>
    <Field name="endDate">2009-05-16T16:00:00Z</Field>
    <Field name="name_title">Backache (Finding)</Field>
    <Field name="name_system">http://purl.bioontology.org/ontology/SNOMEDCT/</Field>
    <Field name="name_identifier">161891005</Field>
  </Model>
</Models>

As a Fact object:

from indivo.models import Problem
from indivo.lib.iso8601 import parse_utc_date as date

problem_fact = Problem(
    startDate=date("2009-05-16T12:00:00Z"),
    endDate=date("2009-05-16T16:00:00Z"),
    name_title="Backache (finding)",
    name_system="http://purl.bioontology.org/ontology/SNOMEDCT/",
    name_identifier="161891005",
    )