Examples of MedicationFrequencyModifier


Examples of org.apache.ctakes.typesystem.type.textsem.MedicationFrequencyModifier

      //form.addToIndexes(jcas); // don't need to be able to get these directly from the AnnotationIndex
      medicationMention.setMedicationForm(modifier);
    }

    if (fromAnnotation.getFrequencyUnit()!=null || fromAnnotation.getFrequency()!=null) {
      MedicationFrequencyModifier modifier = new MedicationFrequencyModifier(jcas);
      MedicationFrequency freq = new MedicationFrequency(jcas);
      freq.setNumber(fromAnnotation.getFrequency());
      freq.setUnit(fromAnnotation.getFrequencyUnit());
      modifier.setNormalizedForm(freq);
      modifier.setCategory(fromAnnotation.getFrequency() + fromAnnotation.getFrequencyUnit());
      //freq.addToIndexes(jcas); // don't need to be able to get these directly from the AnnotationIndex
      medicationMention.setMedicationFrequency(modifier);
    }

    if (fromAnnotation.getRoute()!=null) {
      MedicationRouteModifier modifier = new MedicationRouteModifier(jcas);
      MedicationRoute route = new MedicationRoute(jcas);
      route.setValue(fromAnnotation.getRoute());
      modifier.setNormalizedForm(route);
      modifier.setCategory(route.getValue());
      //route.addToIndexes(jcas); // don't need to be able to get these directly from the AnnotationIndex
      medicationMention.setMedicationRoute(modifier);
    }

    if (fromAnnotation.getStrength()!=null || fromAnnotation.getStrengthUnit()!=null) {
      MedicationStrengthModifier modifier = new MedicationStrengthModifier(jcas);
      MedicationStrength strength = new MedicationStrength(jcas);
      strength.setNumber(fromAnnotation.getStrength());
      strength.setUnit(fromAnnotation.getStrengthUnit());
      modifier.setNormalizedForm(strength);
      modifier.setCategory(fromAnnotation.getStrength() + fromAnnotation.getStrengthUnit());
      //strength.addToIndexes(); // don't need to be able to get these directly from the AnnotationIndex
      medicationMention.setMedicationStrength(modifier);
    }

    if (fromAnnotation.getStartDate()!=null) {
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.MedicationFrequencyModifier

          medFormModifier.setCategory(form.getValue());
          medMention.setMedicationForm(medFormModifier);
        }
        if (medEventMention.getMedicationFrequency()!=null) {
          MedicationFrequency frequency = medEventMention.getMedicationFrequency();
          MedicationFrequencyModifier medFrequencyModifier = new MedicationFrequencyModifier(jcas);
          medFrequencyModifier.setNormalizedForm(frequency);
          medFrequencyModifier.setCategory(frequency.getNumber() + frequency.getUnit());
          medMention.setMedicationFrequency(medFrequencyModifier);
        }
        if (medEventMention.getMedicationRoute()!=null) {
          MedicationRoute route = medEventMention.getMedicationRoute();
          MedicationRouteModifier medRouteModifier = new MedicationRouteModifier(jcas);
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.MedicationFrequencyModifier

        if (number != null) {
          String numberString = number.stringSlots.get("frequency_number_normalization");
          attribute.setNumber(numberString);
        }
        attribute.addToIndexes();
        MedicationFrequencyModifier modifier = new MedicationFrequencyModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("Frequency number".equals(annotation.type)) {
        // already handled in "Frequency" above
        stringSlots.remove("frequency_number_normalization");

      } else if ("Frequency unit".equals(annotation.type)) {
        // already handled in "Frequency" above
        stringSlots.remove("frequency_unit_values");

      } else if ("Route".equals(annotation.type)) {
        String value = stringSlots.remove("route_values");
        MedicationRoute attribute = new MedicationRoute(jCas);
        attribute.setValue(value);
        attribute.addToIndexes();
        MedicationRouteModifier modifier = new MedicationRouteModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);
       
      } else if ("Status change".equals(annotation.type)) {
        String value = stringSlots.remove("change_status_value");
        MedicationStatusChange attribute = new MedicationStatusChange(jCas);
        attribute.setValue(value);
        attribute.addToIndexes();
        MedicationStatusChangeModifier modifier = new MedicationStatusChangeModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("Strength".equals(annotation.type)) {
        KnowtatorAnnotation unit = annotationSlots.remove("strength_unit");
        KnowtatorAnnotation number = annotationSlots.remove("strength_number");
        MedicationStrength attribute = new MedicationStrength(jCas);
        if (unit != null) {
          KnowtatorAnnotation.Span unitSpan = unit.getCoveringSpan();
          String unitString = text.substring(unitSpan.begin, unitSpan.end);
          attribute.setUnit(unitString);
        }
        if (number != null) {
          KnowtatorAnnotation.Span numberSpan = number.getCoveringSpan();
          String numberString = text.substring(numberSpan.begin, numberSpan.end);
          attribute.setNumber(numberString);
        }
        attribute.addToIndexes();
        MedicationStrengthModifier modifier = new MedicationStrengthModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("Strength number".equals(annotation.type)) {
        // already handled in "Strength" above

      } else if ("Strength unit".equals(annotation.type)) {
        // already handled in "Strength" above

      } else if ("device_class".equals(annotation.type)) {
        String code = stringSlots.remove("associatedCode");
        ProcedureDevice attribute = new ProcedureDevice(jCas);
        attribute.setValue(code);
        ProcedureDeviceModifier modifier = new ProcedureDeviceModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("method_class".equals(annotation.type)) {
        String code = stringSlots.remove("associatedCode");
        ProcedureMethod attribute = new ProcedureMethod(jCas);
        attribute.setValue(code);
        ProcedureMethodModifier modifier = new ProcedureMethodModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("severity_class".equals(annotation.type)) {
        Severity attribute = new Severity(jCas);
        attribute.setValue(stringSlots.remove("severity_normalization"));
        attribute.addToIndexes();
        SeverityModifier modifier = new SeverityModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setTypeID(CONST.MODIFIER_TYPE_ID_SEVERITY_CLASS);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("Date".equals(annotation.type)) {
        String month = stringSlots.remove("month");
        String day = stringSlots.remove("day");
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.MedicationFrequencyModifier

        if (number != null) {
          String numberString = number.stringSlots.get("frequency_number_normalization");
          attribute.setNumber(numberString);
        }
        attribute.addToIndexes();
        MedicationFrequencyModifier modifier = new MedicationFrequencyModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("Frequency number".equals(annotation.type)) {
        // already handled in "Frequency" above
        stringSlots.remove("frequency_number_normalization");

      } else if ("Frequency unit".equals(annotation.type)) {
        // already handled in "Frequency" above
        stringSlots.remove("frequency_unit_values");

      } else if ("Route".equals(annotation.type)) {
        String value = stringSlots.remove("route_values");
        MedicationRoute attribute = new MedicationRoute(jCas);
        attribute.setValue(value);
        attribute.addToIndexes();
        MedicationRouteModifier modifier = new MedicationRouteModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);
       
      } else if ("Status change".equals(annotation.type)) {
        String value = stringSlots.remove("change_status_value");
        MedicationStatusChange attribute = new MedicationStatusChange(jCas);
        attribute.setValue(value);
        attribute.addToIndexes();
        MedicationStatusChangeModifier modifier = new MedicationStatusChangeModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("Strength".equals(annotation.type)) {
        KnowtatorAnnotation unit = annotationSlots.remove("strength_unit");
        KnowtatorAnnotation number = annotationSlots.remove("strength_number");
        MedicationStrength attribute = new MedicationStrength(jCas);
        if (unit != null) {
          KnowtatorAnnotation.Span unitSpan = unit.getCoveringSpan();
          String unitString = text.substring(unitSpan.begin, unitSpan.end);
          attribute.setUnit(unitString);
        }
        if (number != null) {
          KnowtatorAnnotation.Span numberSpan = number.getCoveringSpan();
          String numberString = text.substring(numberSpan.begin, numberSpan.end);
          attribute.setNumber(numberString);
        }
        attribute.addToIndexes();
        MedicationStrengthModifier modifier = new MedicationStrengthModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("Strength number".equals(annotation.type)) {
        // already handled in "Strength" above

      } else if ("Strength unit".equals(annotation.type)) {
        // already handled in "Strength" above

      } else if ("device_class".equals(annotation.type)) {
        String code = stringSlots.remove("associatedCode");
        ProcedureDevice attribute = new ProcedureDevice(jCas);
        attribute.setValue(code);
        ProcedureDeviceModifier modifier = new ProcedureDeviceModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("method_class".equals(annotation.type)) {
        String code = stringSlots.remove("associatedCode");
        ProcedureMethod attribute = new ProcedureMethod(jCas);
        attribute.setValue(code);
        ProcedureMethodModifier modifier = new ProcedureMethodModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("severity_class".equals(annotation.type)) {
        Severity attribute = new Severity(jCas);
        attribute.setValue(stringSlots.remove("severity_normalization"));
        attribute.addToIndexes();
        SeverityModifier modifier = new SeverityModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setTypeID(CONST.MODIFIER_TYPE_ID_SEVERITY_CLASS);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("Date".equals(annotation.type)) {
        String month = stringSlots.remove("month");
        String day = stringSlots.remove("day");
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.MedicationFrequencyModifier

      //form.addToIndexes(jcas); // don't need to be able to get these directly from the AnnotationIndex
      medicationMention.setMedicationForm(modifier);
    }

    if (fromAnnotation.getFrequencyUnit()!=null || fromAnnotation.getFrequency()!=null) {
      MedicationFrequencyModifier modifier = new MedicationFrequencyModifier(jcas);
      MedicationFrequency freq = new MedicationFrequency(jcas);
      freq.setNumber(fromAnnotation.getFrequency());
      freq.setUnit(fromAnnotation.getFrequencyUnit());
      modifier.setNormalizedForm(freq);
      modifier.setCategory(fromAnnotation.getFrequency() + fromAnnotation.getFrequencyUnit());
      //freq.addToIndexes(jcas); // don't need to be able to get these directly from the AnnotationIndex
      medicationMention.setMedicationFrequency(modifier);
    }

    if (fromAnnotation.getRoute()!=null) {
      MedicationRouteModifier modifier = new MedicationRouteModifier(jcas);
      MedicationRoute route = new MedicationRoute(jcas);
      route.setValue(fromAnnotation.getRoute());
      modifier.setNormalizedForm(route);
      modifier.setCategory(route.getValue());
      //route.addToIndexes(jcas); // don't need to be able to get these directly from the AnnotationIndex
      medicationMention.setMedicationRoute(modifier);
    }

    if (fromAnnotation.getStrength()!=null || fromAnnotation.getStrengthUnit()!=null) {
      MedicationStrengthModifier modifier = new MedicationStrengthModifier(jcas);
      MedicationStrength strength = new MedicationStrength(jcas);
      strength.setNumber(fromAnnotation.getStrength());
      strength.setUnit(fromAnnotation.getStrengthUnit());
      modifier.setNormalizedForm(strength);
      modifier.setCategory(fromAnnotation.getStrength() + fromAnnotation.getStrengthUnit());
      //strength.addToIndexes(); // don't need to be able to get these directly from the AnnotationIndex
      medicationMention.setMedicationStrength(modifier);
    }

    if (fromAnnotation.getStartDate()!=null) {
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.MedicationFrequencyModifier

      //form.addToIndexes(jcas); // don't need to be able to get these directly from the AnnotationIndex
      medicationMention.setMedicationForm(modifier);
    }

    if (fromAnnotation.getFrequencyUnit()!=null || fromAnnotation.getFrequency()!=null) {
      MedicationFrequencyModifier modifier = new MedicationFrequencyModifier(jcas);
      MedicationFrequency freq = new MedicationFrequency(jcas);
      freq.setNumber(fromAnnotation.getFrequency());
      freq.setUnit(fromAnnotation.getFrequencyUnit());
      modifier.setNormalizedForm(freq);
      modifier.setCategory(fromAnnotation.getFrequency() + fromAnnotation.getFrequencyUnit());
      //freq.addToIndexes(jcas); // don't need to be able to get these directly from the AnnotationIndex
      medicationMention.setMedicationFrequency(modifier);
    }

    if (fromAnnotation.getRoute()!=null) {
      MedicationRouteModifier modifier = new MedicationRouteModifier(jcas);
      MedicationRoute route = new MedicationRoute(jcas);
      route.setValue(fromAnnotation.getRoute());
      modifier.setNormalizedForm(route);
      modifier.setCategory(route.getValue());
      //route.addToIndexes(jcas); // don't need to be able to get these directly from the AnnotationIndex
      medicationMention.setMedicationRoute(modifier);
    }

    if (fromAnnotation.getStrength()!=null || fromAnnotation.getStrengthUnit()!=null) {
      MedicationStrengthModifier modifier = new MedicationStrengthModifier(jcas);
      MedicationStrength strength = new MedicationStrength(jcas);
      strength.setNumber(fromAnnotation.getStrength());
      strength.setUnit(fromAnnotation.getStrengthUnit());
      modifier.setNormalizedForm(strength);
      modifier.setCategory(fromAnnotation.getStrength() + fromAnnotation.getStrengthUnit());
      //strength.addToIndexes(); // don't need to be able to get these directly from the AnnotationIndex
      medicationMention.setMedicationStrength(modifier);
    }

    if (fromAnnotation.getStartDate()!=null) {
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.MedicationFrequencyModifier

          medFormModifier.setCategory(form.getValue());
          medMention.setMedicationForm(medFormModifier);
        }
        if (medEventMention.getMedicationFrequency()!=null) {
          MedicationFrequency frequency = medEventMention.getMedicationFrequency();
          MedicationFrequencyModifier medFrequencyModifier = new MedicationFrequencyModifier(jcas);
          medFrequencyModifier.setNormalizedForm(frequency);
          medFrequencyModifier.setCategory(frequency.getNumber() + frequency.getUnit());
          medMention.setMedicationFrequency(medFrequencyModifier);
        }
        if (medEventMention.getMedicationRoute()!=null) {
          MedicationRoute route = medEventMention.getMedicationRoute();
          MedicationRouteModifier medRouteModifier = new MedicationRouteModifier(jcas);
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.MedicationFrequencyModifier

        if (number != null) {
          String numberString = number.stringSlots.get("frequency_number_normalization");
          attribute.setNumber(numberString);
        }
        attribute.addToIndexes();
        MedicationFrequencyModifier modifier = new MedicationFrequencyModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("Frequency number".equals(annotation.type)) {
        // already handled in "Frequency" above
        stringSlots.remove("frequency_number_normalization");

      } else if ("Frequency unit".equals(annotation.type)) {
        // already handled in "Frequency" above
        stringSlots.remove("frequency_unit_values");

      } else if ("Route".equals(annotation.type)) {
        String value = stringSlots.remove("route_values");
        MedicationRoute attribute = new MedicationRoute(jCas);
        attribute.setValue(value);
        attribute.addToIndexes();
        MedicationRouteModifier modifier = new MedicationRouteModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);
       
      } else if ("Status change".equals(annotation.type)) {
        String value = stringSlots.remove("change_status_value");
        MedicationStatusChange attribute = new MedicationStatusChange(jCas);
        attribute.setValue(value);
        attribute.addToIndexes();
        MedicationStatusChangeModifier modifier = new MedicationStatusChangeModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("Strength".equals(annotation.type)) {
        KnowtatorAnnotation unit = annotationSlots.remove("strength_unit");
        KnowtatorAnnotation number = annotationSlots.remove("strength_number");
        MedicationStrength attribute = new MedicationStrength(jCas);
        if (unit != null) {
          KnowtatorAnnotation.Span unitSpan = unit.getCoveringSpan();
          String unitString = text.substring(unitSpan.begin, unitSpan.end);
          attribute.setUnit(unitString);
        }
        if (number != null) {
          KnowtatorAnnotation.Span numberSpan = number.getCoveringSpan();
          String numberString = text.substring(numberSpan.begin, numberSpan.end);
          attribute.setNumber(numberString);
        }
        attribute.addToIndexes();
        MedicationStrengthModifier modifier = new MedicationStrengthModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("Strength number".equals(annotation.type)) {
        // already handled in "Strength" above

      } else if ("Strength unit".equals(annotation.type)) {
        // already handled in "Strength" above

      } else if ("device_class".equals(annotation.type)) {
        String code = stringSlots.remove("associatedCode");
        ProcedureDevice attribute = new ProcedureDevice(jCas);
        attribute.setValue(code);
        ProcedureDeviceModifier modifier = new ProcedureDeviceModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("method_class".equals(annotation.type)) {
        String code = stringSlots.remove("associatedCode");
        ProcedureMethod attribute = new ProcedureMethod(jCas);
        attribute.setValue(code);
        ProcedureMethodModifier modifier = new ProcedureMethodModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("severity_class".equals(annotation.type)) {
        Severity attribute = new Severity(jCas);
        attribute.setValue(stringSlots.remove("severity_normalization"));
        attribute.addToIndexes();
        SeverityModifier modifier = new SeverityModifier(jCas, coveringSpan.begin, coveringSpan.end);
        modifier.setTypeID(CONST.MODIFIER_TYPE_ID_SEVERITY_CLASS);
        modifier.setNormalizedForm(attribute);
        modifier.addToIndexes();
        idAnnotationMap.put(annotation.id, modifier);

      } else if ("Date".equals(annotation.type)) {
        String month = stringSlots.remove("month");
        String day = stringSlots.remove("day");
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.MedicationFrequencyModifier

                if (dosageModifier != null) {
                  MedicationDosage d = (MedicationDosage) dosageModifier.getNormalizedForm();
                  if (d!=null) medicationDosageString = d.getValue();
                }
                String medicationFrequencyNumber = "null";
                MedicationFrequencyModifier freqModifier = neAnnot.getMedicationFrequency();
                if (freqModifier != null) {
                  MedicationFrequency f = (MedicationFrequency) freqModifier.getNormalizedForm();
                  if (f != null) medicationFrequencyNumber = f.getNumber()+" "+f.getUnit();
                }
                String duration = "null";
                MedicationDurationModifier durationModifier = neAnnot.getMedicationDuration();
                if (durationModifier != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.