Example #1
0
def create_element_definition(s, e, a, v, url, d, t):

    try:
        edef = ElementDefinition.objects.get(spec=s,
                                             element=e,
                                             attribute=a,
                                             value=v)
        if v == '':
            v = '*'
        print("  Updating ElementDefinition: " + str(s) + " for " + e + '[' +
              a + '=' + v + ']')
        edef.description = d
        edef.type = t
        edef.url = url
    except ObjectDoesNotExist:
        edef = ElementDefinition(spec=s,
                                 element=e,
                                 attribute=a,
                                 value=v,
                                 url=url,
                                 description=d,
                                 type=t)
        print("  Creating ElementDefinition: " + s.title + " for " + url)
    edef.save()
    return edef
def create_ElementDefinition(spec, element, attribute, value, url, description, type):
  try:
    element = ElementDefinition.objects.get(spec=spec, element=element, attribute=attribute, value=value)
    print "  Updating ElementDefinition: " + element.spec.title + " for " + element.url 
    element.description = description
    element.type = type
    element.url = url
  except ObjectDoesNotExist:
    print "  Creating ElementDefinition: " + spec.title  + " for " + url
    element = ElementDefinition(spec=spec, element=element, attribute=attribute, value=value, url=url, description=description, type=type)
  element.save()
  return element
Example #3
0
def create_element_definition(s, e, a, v, url, d, t):

  try:
    edef = ElementDefinition.objects.get(spec=s, element=e, attribute=a, value=v)
    if v == '':
      v = '*'
    print("  Updating ElementDefinition: " + str(s) + " for " + e + '[' + a + '=' + v + ']')
    edef.description = d
    edef.type = t
    edef.url = url
  except ObjectDoesNotExist:
    edef = ElementDefinition(spec=s, element=e, attribute=a, value=v, url=url, description=d, type=t)
    print("  Creating ElementDefinition: " + s.title  + " for " + url)
  edef.save()
  return edef