Search in sources :

Example 11 with ConceptBuilder

use of org.openmrs.module.metadatadeploy.builder.ConceptBuilder in project openmrs-module-pihcore by PIH.

the class ClinicalConsultationConcepts method installNewVersion.

@Override
protected void installNewVersion() throws Exception {
    Concept yes = MetadataUtils.existing(Concept.class, CommonConcepts.Concepts.YES);
    Concept no = MetadataUtils.existing(Concept.class, CommonConcepts.Concepts.NO);
    Concept unknown = MetadataUtils.existing(Concept.class, CommonConcepts.Concepts.UNKNOWN);
    Concept other = MetadataUtils.existing(Concept.class, CommonConcepts.Concepts.OTHER_NON_CODED);
    Concept none = MetadataUtils.existing(Concept.class, CommonConcepts.Concepts.NONE);
    Concept notApplicableConcept = MetadataUtils.existing(Concept.class, CommonConcepts.Concepts.NOT_APPLICABLE);
    Concept father = MetadataUtils.existing(Concept.class, AnswerConcepts.Concepts.FATHER);
    Concept mother = MetadataUtils.existing(Concept.class, AnswerConcepts.Concepts.MOTHER);
    Concept brother = MetadataUtils.existing(Concept.class, AnswerConcepts.Concepts.BROTHER);
    Concept sister = MetadataUtils.existing(Concept.class, AnswerConcepts.Concepts.SISTER);
    Concept sibling = MetadataUtils.existing(Concept.class, AnswerConcepts.Concepts.SIBLING);
    Concept partnerOrSpouse = MetadataUtils.existing(Concept.class, AnswerConcepts.Concepts.PARTNER_OR_SPOUSE);
    Concept guardian = MetadataUtils.existing(Concept.class, AnswerConcepts.Concepts.GUARDIAN);
    Concept otherRelative = MetadataUtils.existing(Concept.class, AnswerConcepts.Concepts.OTHER_RELATIVE);
    // in CIEL this is called PAST MEDICAL HISTORY ADDED, but we give it a better name
    // .mapping(new ConceptMapBuilder("").type(narrowerThan).ensureTerm(pih, "10140").build())
    Concept pmhWhich = install(new ConceptBuilder(Concepts.PAST_MEDICAL_HISTORY_FINDING).datatype(coded).conceptClass(diagnosis).name("1908BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "Past medical history finding", Locale.ENGLISH, ConceptNameType.FULLY_SPECIFIED).description("1470FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "Coded list of past medical history problems but not procedures which are coded under Past Surgical History.", Locale.ENGLISH).mapping(new ConceptMapBuilder("171868ABBBBBBBBBBBBBBBBBBBBBBBBBBBBB").type(sameAs).ensureTerm(ciel, "1628").build()).build());
    // .mapping(new ConceptMapBuilder("").type(narrowerThan).ensureTerm(pih, "10141").build())
    Concept isSymptomPresent = install(new ConceptBuilder(Concepts.PAST_MEDICAL_HISTORY_PRESENCE).datatype(coded).conceptClass(diagnosis).name("2009BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "Sign/symptom present", Locale.ENGLISH, ConceptNameType.FULLY_SPECIFIED).answers(yes, no, unknown).mapping(new ConceptMapBuilder("171968ABBBBBBBBBBBBBBBBBBBBBBBBBBBBB").type(sameAs).ensureTerm(ciel, "1729").build()).build());
    // TODO waiting for confirmation from Andy that this is appropriate as comments
    Concept pmhComment = install(new ConceptBuilder(Concepts.PAST_MEDICAL_HISTORY_COMMENT).datatype(text).conceptClass(question).name("108123BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "Past medical history added (text)", Locale.ENGLISH, ConceptNameType.FULLY_SPECIFIED).mapping(new ConceptMapBuilder("217354ABBBBBBBBBBBBBBBBBBBBBBBBBBBBB").type(sameAs).ensureTerm(ciel, "160221").build()).build());
    Concept pmhConstruct = install(new ConceptBuilder(Concepts.PAST_MEDICAL_HISTORY_CONSTRUCT).datatype(notApplicable).conceptClass(misc).name("1913BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "Past medical history", Locale.ENGLISH, ConceptNameType.FULLY_SPECIFIED).name("86916BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "PMH", Locale.ENGLISH, ConceptNameType.SHORT).setMembers(pmhWhich, isSymptomPresent, pmhComment).mapping(new ConceptMapBuilder("171873ABBBBBBBBBBBBBBBBBBBBBBBBBBBBB").type(sameAs).ensureTerm(ciel, "1633").build()).build());
    Concept famHxDiagnosis = install(new ConceptBuilder(Concepts.FAMILY_HISTORY_DIAGNOSIS).datatype(coded).conceptClass(// CIEL says Diagnosis, but this is wrong
    misc).name("109016BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "Family history diagnosis", Locale.ENGLISH, ConceptNameType.FULLY_SPECIFIED).mapping(new ConceptMapBuilder("217715ABBBBBBBBBBBBBBBBBBBBBBBBBBBBB").type(sameAs).ensureTerm(ciel, "160592").build()).build());
    // CIEL:1560 (Family Member) is both a question and an answer. At PIH we have two existing concepts for this purpose.
    // This one is only used as a question, so we mark it as NARROWER-THAN CIEL:1560.
    // The answer concept is in the {@link AnswerConcepts} bundle
    // TODO decide whether to move this concept to the Socioeconomic bundle
    Concept famHxRelationship = install(new ConceptBuilder(Concepts.FAMILY_HISTORY_RELATIONSHIP).datatype(coded).conceptClass(question).name("3e2256c6-26fe-102b-80cb-0017a47871b2", "Relationship of relative to patient", Locale.ENGLISH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).name("93bc0d72-07d4-102c-b5fa-0017a47871b2", "CONTACT_REL", Locale.ENGLISH, ConceptNameType.SHORT).name("0502ccd4-014b-4e2b-9734-76d17d46afc6", "Relation du rapport au patient", Locale.FRENCH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).description("ecf0bb66-07fe-102c-b5fa-0017a47871b2", "What is the relationship of this relative to this patient?", Locale.ENGLISH).mapping(new ConceptMapBuilder("b220b998-4864-102e-96e9-000c29c2a5d7").type(sameAs).ensureTerm(pih, "2172").build()).mapping(new ConceptMapBuilder("758701ce-4943-102e-96e9-000c29c2a5d7").type(sameAs).ensureTerm(pih, "RELATIONSHIP OF RELATIVE TO PATIENT").build()).mapping(new ConceptMapBuilder("e9335480-d593-11e4-9dcf-b36e1005e77b").type(narrowerThan).ensureTerm(ciel, "1560").build()).answers(father, mother, otherRelative, sibling, brother, sister, partnerOrSpouse, guardian).build());
    Concept famHxComment = install(new ConceptBuilder(Concepts.FAMILY_HISTORY_COMMENT).datatype(text).conceptClass(question).name("109055BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "Family history comment", Locale.ENGLISH, ConceptNameType.FULLY_SPECIFIED).mapping(new ConceptMapBuilder("217741ABBBBBBBBBBBBBBBBBBBBBBBBBBBBB").type(sameAs).ensureTerm(ciel, "160618").build()).build());
    Concept famHxConstruct = install(new ConceptBuilder(Concepts.FAMILY_HISTORY_CONSTRUCT).datatype(notApplicable).conceptClass(// CIEL says Finding but this is wrong
    convSet).name("109017BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "Patient's family history list", Locale.ENGLISH, ConceptNameType.FULLY_SPECIFIED).name("109019BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "Family history list", Locale.ENGLISH, null).setMembers(famHxDiagnosis, famHxRelationship, isSymptomPresent, famHxComment).mapping(new ConceptMapBuilder("217716ABBBBBBBBBBBBBBBBBBBBBBBBBBBBB").type(sameAs).ensureTerm(ciel, "160593").build()).build());
}
Also used : Concept(org.openmrs.Concept) ConceptBuilder(org.openmrs.module.metadatadeploy.builder.ConceptBuilder) ConceptMapBuilder(org.openmrs.module.metadatadeploy.builder.ConceptMapBuilder)

Example 12 with ConceptBuilder

use of org.openmrs.module.metadatadeploy.builder.ConceptBuilder in project openmrs-module-pihcore by PIH.

the class CommonConcepts method installNewVersion.

@Override
protected void installNewVersion() throws Exception {
    install(new ConceptBuilder(Concepts.YES).datatype(notApplicable).conceptClass(misc).name("3e15161e-26fe-102b-80cb-0017a47871b2", "Yes", Locale.ENGLISH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).name("0b931af0-15f5-102d-96e4-000c29c2a5d7", "Oui", Locale.FRENCH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).name("541f1720-0abe-49dd-b4f6-7de87ce05917", "Wi", locale_HAITI, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).name("733469c8-435d-491a-9f8b-b3c42219b6d4", "Sí", locale_SPANISH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).description("ece437ba-07fe-102c-b5fa-0017a47871b2", "Generic answer to a question.", Locale.ENGLISH).mapping(new ConceptMapBuilder("7568887a-4943-102e-96e9-000c29c2a5d7").type(sameAs).ensureTerm(pih, "YES").build()).mapping(new ConceptMapBuilder("b20d114a-4864-102e-96e9-000c29c2a5d7").type(sameAs).ensureTerm(pih, "1065").build()).build());
    install(new ConceptBuilder(Concepts.NO).datatype(notApplicable).conceptClass(misc).name("3e151786-26fe-102b-80cb-0017a47871b2", "No", Locale.ENGLISH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).name("743d14ca-dd31-4ed7-8bfb-b2e4c98a2609", "Non", Locale.FRENCH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).name("5bcc9a17-0a17-4075-84d4-f09882cfaa18", "Non", locale_HAITI, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).name("44f65f8b-844d-41e8-93c8-9ffe66a3b522", "No", locale_SPANISH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).description("d07abafd-ea95-4edd-9c84-ee85592fc91f", "Generic answer to question.", Locale.ENGLISH).mapping(new ConceptMapBuilder("b20d12bc-4864-102e-96e9-000c29c2a5d7").type(sameAs).ensureTerm(pih, "1066").build()).mapping(new ConceptMapBuilder("aefacf53-8e8e-4ed0-9d32-cbd1d14c6639").type(sameAs).ensureTerm(pih, "NO").build()).build());
    install(new ConceptBuilder(Concepts.UNKNOWN).datatype(notApplicable).conceptClass(misc).name("3e1518f8-26fe-102b-80cb-0017a47871b2", "Unknown", Locale.ENGLISH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).name("0b8bdd6c-15f5-102d-96e4-000c29c2a5d7", "DON'T KNOW", Locale.ENGLISH, null).name("0b8bde66-15f5-102d-96e4-000c29c2a5d7", "DO NOT KNOW", Locale.ENGLISH, null).name("0b8bdf56-15f5-102d-96e4-000c29c2a5d7", "Inconnu", Locale.FRENCH, // locale-preferred
    null).name("cfeddfc5-3d6d-40a7-a878-5141afe9d527", "Desconocido", locale_SPANISH, // locale-preferred
    null).description("ece43b8e-07fe-102c-b5fa-0017a47871b2", "Generic answer to a question.", Locale.ENGLISH).description("5a0076f0-1fc0-4c91-8d92-0541eab81216", "réponse générique à la question", Locale.FRENCH).mapping(new ConceptMapBuilder("48d452b4-2448-4b4a-ab17-5993cd2aa765").type(sameAs).ensureTerm(pih, "unknown").build()).mapping(new ConceptMapBuilder("b20d1438-4864-102e-96e9-000c29c2a5d7").type(sameAs).ensureTerm(pih, "1067").build()).mapping(new ConceptMapBuilder("aef53e25-42b3-4e15-b072-773408c42fcf").type(sameAs).ensureTerm(emrapi, "Unknown Cause of Death").build()).build());
    install(new ConceptBuilder(Concepts.OTHER_NON_CODED).datatype(notApplicable).conceptClass(misc).name("1724c34c-6f89-4bd0-8bf7-ec83c3ba53fb", "Other", Locale.ENGLISH, // locale-preferred
    null).name("0b6f94ea-15f5-102d-96e4-000c29c2a5d7", "Other non-coded", Locale.ENGLISH, ConceptNameType.FULLY_SPECIFIED).name("110860BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "Otro no codificado", locale_SPANISH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).name("af406c44-9ddb-4808-8caa-8361f7f95028", "Autre", Locale.FRENCH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).name("14a06afe-a240-4d52-8eda-a762857aabe8", "Autre, non spécifiée", Locale.FRENCH, null).name("105802BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "Autre et non codé", Locale.FRENCH, null).name("abc2ce9a-2a12-46b5-9bd7-cee4d9f61b08", "Lòt", locale_HAITI, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).name("110113BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "Nyinginezo", locale_SWAHILI, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).description("0b40b634-15f5-102d-96e4-000c29c2a5d7", "A generic answer which is a coded response to a question.  If appropriate, there might be a corresponding question which contains this non-coded response (ie. Deliver Location Non-Coded where datatype=text)", Locale.ENGLISH).mapping(new ConceptMapBuilder("b299b5b4-4864-102e-96e9-000c29c2a5d7").type(sameAs).ensureTerm(pih, "5622").build()).mapping(new ConceptMapBuilder("75aa9616-4943-102e-96e9-000c29c2a5d7").type(sameAs).ensureTerm(pih, "OTHER NON-CODED").build()).mapping(new ConceptMapBuilder("137878ABBBBBBBBBBBBBBBBBBBBBBBBBBBBB").type(sameAs).ensureTerm(pih, "OTHER").build()).mapping(new ConceptMapBuilder("04ef5e6c-3062-432a-ad7f-0581a6cac76d").type(sameAs).ensureTerm(ciel, "5622").build()).build());
    install(new ConceptBuilder(Concepts.FREE_TEXT_GENERAL).datatype(text).conceptClass(question).name("109086BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "Free text general", Locale.ENGLISH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).name("109085BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "Freetext general", Locale.ENGLISH, null).description("16778FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "This is a freetext field for general use.  It should be tied to another concept as a child.", Locale.ENGLISH).mapping(new ConceptMapBuilder("567ec656-4791-4423-8fc3-ffd215eb2eb8").type(sameAs).ensureTerm(pih, "GENERAL FREE TEXT").build()).mapping(new ConceptMapBuilder("217755ABBBBBBBBBBBBBBBBBBBBBBBBBBBBB").type(sameAs).ensureTerm(ciel, "160632").build()).mapping(new ConceptMapBuilder("e65c0819-271d-4289-85a8-20d22b10d08a").type(sameAs).ensureTerm(pih, "9721").build()).build());
    install(new ConceptBuilder(Concepts.NONE).datatype(notApplicable).conceptClass(misc).name("3e15729e-26fe-102b-80cb-0017a47871b2", "None", Locale.ENGLISH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).name("3e157424-26fe-102b-80cb-0017a47871b2", "Aucun", Locale.FRENCH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).name("c369fba3-5a4f-47f8-9014-62b941aac8cb", "Ninguno", locale_SPANISH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).description("ece4993a-07fe-102c-b5fa-0017a47871b2", "Generic descriptive answer.", Locale.ENGLISH).mapping(new ConceptMapBuilder("7568a490-4943-102e-96e9-000c29c2a5d7").type(sameAs).ensureTerm(pih, "NONE").build()).mapping(new ConceptMapBuilder("b20d518c-4864-102e-96e9-000c29c2a5d7").type(sameAs).ensureTerm(pih, "1107").build()).build());
    install(new ConceptBuilder(Concepts.NOT_APPLICABLE).datatype(notApplicable).conceptClass(misc).name("3e16182a-26fe-102b-80cb-0017a47871b2", "Not applicable", Locale.ENGLISH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).name("0b8e7ce8-15f5-102d-96e4-000c29c2a5d7", "Sans objet", Locale.FRENCH, // locale-preferred
    null).name("f5dfdb38-d5db-102d-ad2a-000c29c2a5d7", "Pas valable", Locale.FRENCH, null).name("0b8e7bee-15f5-102d-96e4-000c29c2a5d7", "Ne pas applicable", Locale.FRENCH, null).name("1557bb2d-f6a0-43a8-85dd-6e90655fd351", "No aplica", locale_SPANISH, // locale-preferred
    ConceptNameType.FULLY_SPECIFIED).description("ece55cc6-07fe-102c-b5fa-0017a47871b2", "Generic response to a question.  The question doesn't directly apply to the person.", Locale.ENGLISH).mapping(new ConceptMapBuilder("b20f276e-4864-102e-96e9-000c29c2a5d7").type(sameAs).ensureTerm(pih, "1175").build()).build());
}
Also used : ConceptBuilder(org.openmrs.module.metadatadeploy.builder.ConceptBuilder) ConceptMapBuilder(org.openmrs.module.metadatadeploy.builder.ConceptMapBuilder)

Aggregations

ConceptBuilder (org.openmrs.module.metadatadeploy.builder.ConceptBuilder)12 ConceptMapBuilder (org.openmrs.module.metadatadeploy.builder.ConceptMapBuilder)12 Concept (org.openmrs.Concept)10 ConceptClass (org.openmrs.ConceptClass)2 ConceptDatatype (org.openmrs.ConceptDatatype)2 ConceptMapType (org.openmrs.ConceptMapType)2 ConceptSource (org.openmrs.ConceptSource)2 ConceptNumericBuilder (org.openmrs.module.metadatadeploy.builder.ConceptNumericBuilder)2