Esempio n. 1
0
    def __init__(self, *args, **kwargs):
        super(ConceptNewForm, self).__init__(*args, **kwargs)
        _concept_class_list = [(cl) for cl in _get_concept_class_list()]
        _datatype_list = [(d) for d in _get_datatype_list()]

        self.fields['concept_class'].widget = ComboBoxWidget(data_list=_concept_class_list, name="concept_class")
        self.fields['datatype'].widget      = ComboBoxWidget(data_list=_datatype_list,      name="datatype_list")
Esempio n. 2
0
    def __init__(self, *args, **kwargs):
        super(ConceptNewForm, self).__init__(*args, **kwargs)

        self.fields['concept_class'].choices = [
            (cl, cl) for cl in _get_concept_class_list()
        ]
        self.fields['datatype'].choices = [(d, d)
                                           for d in _get_datatype_list()]
 def __init__(self):
     super(Command, self).__init__()
     self.ocl = None
     self.username = None
     self.password = None
     self.web_host = os.environ['OCL_WEB_HOST']
     self.ORG_ID = None
     self.locale_list = [d['code'] for d in _get_locale_list()]
     self.source_type_list = _get_source_type_list()
     self.concept_class_list = _get_concept_class_list()
     self.datatype_list = _get_datatype_list()
Esempio n. 4
0
 def __init__(self):
     super(Command, self).__init__()
     self.ocl = None
     self.username = None
     self.password = None
     self.api_host = os.environ['OCL_API_HOST']
     self.web_host = os.environ['OCL_WEB_HOST']
     self.ORG_ID = None
     self.SOURCE_ID = None
     self.locale_list = [d['code'] for d in _get_locale_list()]
     self.source_type_list = _get_source_type_list()
     self.concept_class_list = _get_concept_class_list()
     self.datatype_list = _get_datatype_list()
Esempio n. 5
0
    def __init__(self, *args, **kwargs):
        super(ConceptNewForm, self).__init__(*args, **kwargs)

        self.fields['concept_class'].choices = [(cl, cl) for cl in _get_concept_class_list()]
        self.fields['datatype'].choices = [(d, d) for d in _get_datatype_list()]
Esempio n. 6
0
class ConceptNewForm(forms.Form):
    """
    Concept new form
    """
    # TODO([email protected]): Populate all dropdowns dynamically

    required_css_class = 'required'

    # TODO: Validate concept ID is unique
    concept_id = forms.CharField(
        label=_('Concept ID'),
        max_length=256,
        required=True,
        help_text=_(
            '<small>Allowed characters are : Alphabets(a-z,A-Z), Numbers(0-9) and Hyphen(-) </small><br/>'
            '<small>Your new concept will live at: '
            '<span id="new_concept_base_url">/[owner-type]/[owner]/sources/'
            '[source]/concepts/</span>'
            '<span id="new_concept_id" style="font-weight:bold;">'
            '[concept-id]</span></small>'),
        widget=forms.TextInput(attrs={'placeholder': "e.g. A15.0"}))

    # TODO: Populate this dynamically
    concept_class = forms.ChoiceField(choices=[
        (v, v) for v in _get_concept_class_list()
    ],
                                      label=_('Concept Class'),
                                      required=True)

    # TODO: Populate this dynamically
    datatype = forms.ChoiceField(choices=[(v, v)
                                          for v in _get_datatype_list()],
                                 label=_('Datatype'),
                                 initial='None',
                                 required=True)

    # TODO: Put locale, name, and name_type on the same row

    # TODO: Populate this dynamically
    locale = forms.ChoiceField(
        label=_('Name Locale'),
        required=True,
        help_text=
        _('<small>Choose the locale for the initial name and description</small>'
          ),
        choices=[(d['code'], d['name']) for d in _get_locale_list()])

    name = forms.CharField(
        label=_('Name'),
        max_length=256,
        required=True,
        widget=forms.TextInput(
            attrs={
                'placeholder':
                _("e.g. Tuberculosis of lung, confirmed by sputum "
                  "microscopy with or without culture")
            }))

    # TODO: Populate this dynamically
    name_type = forms.CharField(
        label=_('Name Type'),
        max_length=256,
        required=True,
        widget=forms.TextInput(attrs={'placeholder': "e.g. FULLY_SPECIFIED"}))

    # TODO: Put locale, description, and description_type on the same row

    description = forms.CharField(label=_('Description'),
                                  max_length=1024,
                                  required=False)

    # TODO: Populate this dynamically
    description_type = forms.CharField(label=_('Description Type'),
                                       max_length=128,
                                       required=False)

    external_id = forms.CharField(
        label=_('Concept External ID'),
        required=False,
        widget=forms.TextInput(
            attrs={'placeholder': "e.g. UUID from external system"}))