You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by ja...@apache.org on 2012/10/31 06:26:55 UTC
svn commit: r1403989 [7/28] - in /incubator/ctakes/branches/SHARPn-cTAKES:
Constituency Parser/src/org/chboston/cnlp/ctakes/parser/ Constituency
Parser/src/org/chboston/cnlp/ctakes/parser/uima/ae/ Constituency
Parser/src/org/chboston/cnlp/ctakes/parser...
Modified: incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/ae/LemAssigner.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/ae/LemAssigner.java?rev=1403989&r1=1403988&r2=1403989&view=diff
==============================================================================
--- incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/ae/LemAssigner.java (original)
+++ incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/ae/LemAssigner.java Wed Oct 31 05:26:43 2012
@@ -1,19 +1,12 @@
package edu.mayo.bmi.nlp.parser.ae;
/*
- * Copyright: (c) 2010 Mayo Foundation for Medical Education and
- * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
- * triple-shield Mayo logo are trademarks and service marks of MFMER.
- *
- * Except as contained in the copyright notice above, or as used to identify
- * MFMER as the author of this software, the trade names, trademarks, service
- * marks, or product names of the copyright holder shall not be used in
- * advertising, promotion or otherwise in connection with this software without
- * prior written authorization of the copyright holder.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
Modified: incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/ae/PosAssigner.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/ae/PosAssigner.java?rev=1403989&r1=1403988&r2=1403989&view=diff
==============================================================================
--- incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/ae/PosAssigner.java (original)
+++ incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/ae/PosAssigner.java Wed Oct 31 05:26:43 2012
@@ -1,19 +1,12 @@
package edu.mayo.bmi.nlp.parser.ae;
/*
- * Copyright: (c) 2010 Mayo Foundation for Medical Education and
- * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
- * triple-shield Mayo logo are trademarks and service marks of MFMER.
- *
- * Except as contained in the copyright notice above, or as used to identify
- * MFMER as the author of this software, the trade names, trademarks, service
- * marks, or product names of the copyright holder shall not be used in
- * advertising, promotion or otherwise in connection with this software without
- * prior written authorization of the copyright holder.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
Modified: incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/cr/DependencyFileCollectionReader.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/cr/DependencyFileCollectionReader.java?rev=1403989&r1=1403988&r2=1403989&view=diff
==============================================================================
--- incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/cr/DependencyFileCollectionReader.java (original)
+++ incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/cr/DependencyFileCollectionReader.java Wed Oct 31 05:26:43 2012
@@ -1,19 +1,12 @@
package edu.mayo.bmi.nlp.parser.cr;
/*
- * Copyright: (c) 2010 Mayo Foundation for Medical Education and
- * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
- * triple-shield Mayo logo are trademarks and service marks of MFMER.
- *
- * Except as contained in the copyright notice above, or as used to identify
- * MFMER as the author of this software, the trade names, trademarks, service
- * marks, or product names of the copyright holder shall not be used in
- * advertising, promotion or otherwise in connection with this software without
- * prior written authorization of the copyright holder.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
Modified: incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/util/Delim.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/util/Delim.java?rev=1403989&r1=1403988&r2=1403989&view=diff
==============================================================================
--- incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/util/Delim.java (original)
+++ incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/util/Delim.java Wed Oct 31 05:26:43 2012
@@ -1,19 +1,12 @@
/*
- * Copyright: (c) 2010 Mayo Foundation for Medical Education and
- * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
- * triple-shield Mayo logo are trademarks and service marks of MFMER.
- *
- * Except as contained in the copyright notice above, or as used to identify
- * MFMER as the author of this software, the trade names, trademarks, service
- * marks, or product names of the copyright holder shall not be used in
- * advertising, promotion or otherwise in connection with this software without
- * prior written authorization of the copyright holder.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@@ -40,4 +33,4 @@ public class Delim {
public static String DN_ARC_B = ">";
public static String TRIPLE_DELIM = ",";
-}
\ No newline at end of file
+}
Modified: incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/util/DependencyUtility.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/util/DependencyUtility.java?rev=1403989&r1=1403988&r2=1403989&view=diff
==============================================================================
--- incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/util/DependencyUtility.java (original)
+++ incubator/ctakes/branches/SHARPn-cTAKES/clearparser-wrapper/src/edu/mayo/bmi/nlp/parser/util/DependencyUtility.java Wed Oct 31 05:26:43 2012
@@ -1,18 +1,11 @@
/*
- * Copyright: (c) 2010 Mayo Foundation for Medical Education and
- * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
- * triple-shield Mayo logo are trademarks and service marks of MFMER.
- *
- * Except as contained in the copyright notice above, or as used to identify
- * MFMER as the author of this software, the trade names, trademarks, service
- * marks, or product names of the copyright holder shall not be used in
- * advertising, promotion or otherwise in connection with this software without
- * prior written authorization of the copyright holder.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
Modified: incubator/ctakes/branches/SHARPn-cTAKES/clinical documents pipeline/src/edu/mayo/bmi/uima/cni/ae/ExtractionPrepAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/branches/SHARPn-cTAKES/clinical%20documents%20pipeline/src/edu/mayo/bmi/uima/cni/ae/ExtractionPrepAnnotator.java?rev=1403989&r1=1403988&r2=1403989&view=diff
==============================================================================
--- incubator/ctakes/branches/SHARPn-cTAKES/clinical documents pipeline/src/edu/mayo/bmi/uima/cni/ae/ExtractionPrepAnnotator.java (original)
+++ incubator/ctakes/branches/SHARPn-cTAKES/clinical documents pipeline/src/edu/mayo/bmi/uima/cni/ae/ExtractionPrepAnnotator.java Wed Oct 31 05:26:43 2012
@@ -1,18 +1,11 @@
/*
- * Copyright: (c) 2009 Mayo Foundation for Medical Education and
- * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
- * triple-shield Mayo logo are trademarks and service marks of MFMER.
- *
- * Except as contained in the copyright notice above, or as used to identify
- * MFMER as the author of this software, the trade names, trademarks, service
- * marks, or product names of the copyright holder shall not be used in
- * advertising, promotion or otherwise in connection with this software without
- * prior written authorization of the copyright holder.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@@ -21,8 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.mayo.bmi.uima.cni.ae;
-
+package edu.mayo.bmi.uima.cni.ae;
+
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
@@ -44,168 +37,168 @@ import edu.mayo.bmi.uima.core.type.texts
import edu.mayo.bmi.uima.core.type.textspan.Segment;
import edu.mayo.bmi.uima.core.type.util.Pair;
import edu.mayo.bmi.uima.core.type.util.Pairs;
-
-/**
- * UIMA annotator that prepares the CAS for output - performs
- * some (final) updates to the CAS
- *
- * @author Mayo Clinic
- */
-public class ExtractionPrepAnnotator extends JCasAnnotator_ImplBase {
- private String iv_annotVerPropKey;
- private int iv_annotVer;
-
- /**
- * Method invoked by UIMA framework to initialize this annotator
- */
- public void initialize(UimaContext aCtx)
- throws ResourceInitializationException {
-
- super.initialize(aCtx);
-
- try {
- iv_annotVer = ((Integer) aCtx.getConfigParameterValue("AnnotationVersion")).intValue();
- iv_annotVerPropKey = (String) aCtx.getConfigParameterValue("AnnotationVersionPropKey");
- } catch (Exception e) {
- throw new ResourceInitializationException(e);
- }
-
- }
-
- /**
- * Method invoked by UIMA framework to process a document
- */
- public void process(JCas jcas)
- throws AnalysisEngineProcessException {
- generateUidValues(jcas);
- generateTokenNormForms(jcas);
- assignNamedEntityFeats(jcas);
- storeAnnotationVersion(jcas);
- }
-
-
- /**
- * Stores annotation version as a property JCas object.
- *
- * @param jcas
- */
- private void storeAnnotationVersion(JCas jcas) {
- FSIterator<TOP> itr = jcas.getJFSIndexRepository().getAllIndexedFS(Pairs.type);
- if (itr == null || !itr.hasNext())
- return;
-
- Pairs props = (Pairs) itr.next();
-
- // create a new property array that is one item bigger
- FSArray propArr = props.getPairs();
- FSArray newPropArr = new FSArray(jcas, propArr.size() + 1);
- for (int i = 0; i < propArr.size(); i++) {
- newPropArr.set(i, propArr.get(i));
- }
-
- Pair annotVerProp = new Pair(jcas);
- annotVerProp.setAttribute(iv_annotVerPropKey);
- annotVerProp.setValue(String.valueOf(iv_annotVer));
-
- // add annotation version prop as last item in array
- newPropArr.set(newPropArr.size() - 1, annotVerProp);
- props.setPairs(newPropArr);
- }
-
- /**
- * Generates UID values for all IdentifiedAnnotation objects.
- * This is just a numeric identifier, assigned sequentially.
- */
- private void generateUidValues(JCas jcas) {
- int uid = 0;
- Iterator itr = jcas.getJFSIndexRepository().getAnnotationIndex(
- IdentifiedAnnotation.type).iterator();
- while (itr.hasNext()) {
- IdentifiedAnnotation idAnnot = (IdentifiedAnnotation) itr.next();
- idAnnot.setId(uid);
- uid++;
- }
- }
-
- /**
- * Generates normalized form for each token annotation.
- * Considers whether it is a <code>WordToken</code> with a canonical form
- */
- private void generateTokenNormForms(JCas jcas) {
- JFSIndexRepository indexes = jcas.getJFSIndexRepository();
-
- // Determine and set the normalized form for each <code>BaseToken</code>
- Iterator btaItr = indexes.getAnnotationIndex(BaseToken.type).iterator();
- while (btaItr.hasNext()) {
- BaseToken bta = (BaseToken) btaItr.next();
- String normForm = null;
- if (!(bta instanceof WordToken)) {
- normForm = bta.getCoveredText();
- } else {
- WordToken wta = (WordToken) bta;
- String canonicalForm = wta.getCanonicalForm();
-
-
- // The norm form is the canonical form, if there is one
- // Otherwise the norm form is the token's text.
- if ((canonicalForm != null) && (canonicalForm.length() > 0)) {
- normForm = canonicalForm;
- } else {
- normForm = wta.getCoveredText();
- }
- }
- bta.setNormalizedForm(normForm);
- }
- }
-
- /**
- * Assigns OID and segmentID values to NamedEntities
- */
- private void assignNamedEntityFeats(JCas jcas) {
- JFSIndexRepository indexes = jcas.getJFSIndexRepository();
- // Set keySet = new HashSet();
- // List dupList = new ArrayList();
-
- Set segmentSet = new HashSet();
- Iterator segmentItr = indexes.getAnnotationIndex(Segment.type).iterator();
- while (segmentItr.hasNext()) {
- segmentSet.add(segmentItr.next());
- }
-
- // For each NE, assign segment ID and assign ontology concept OIDs if applicable
- Iterator neItr = indexes.getAnnotationIndex(IdentifiedAnnotation.type).iterator();
- while (neItr.hasNext()) {
-
- IdentifiedAnnotation neAnnot = (IdentifiedAnnotation) neItr.next();
-
- // assign segment ID
- Iterator segItr = segmentSet.iterator();
- while (segItr.hasNext()) {
- Segment seg = (Segment) segItr.next();
- // see if NE is inside this segment
- if ((neAnnot.getBegin() >= seg.getBegin())
- && (neAnnot.getEnd() <= seg.getEnd())) {
- // found segment for this NE
- neAnnot.setSegmentID(seg.getId());
- break;
- }
- }
-
- // assign ontology concept OID values
- FSArray ocArr = neAnnot.getOntologyConceptArr();
- if (ocArr != null) {
- for (int i = 0; i < ocArr.size(); i++) {
- OntologyConcept oc = (OntologyConcept) ocArr.get(i);
- String code = oc.getCode();
- String scheme = oc.getCodingScheme();
-
- StringBuffer oid = new StringBuffer();
- oid.append(code);
- oid.append("#");
- oid.append(scheme);
- oc.setOid(oid.toString());
- }
- }
- }
- }
-}
\ No newline at end of file
+
+/**
+ * UIMA annotator that prepares the CAS for output - performs
+ * some (final) updates to the CAS
+ *
+ * @author Mayo Clinic
+ */
+public class ExtractionPrepAnnotator extends JCasAnnotator_ImplBase {
+ private String iv_annotVerPropKey;
+ private int iv_annotVer;
+
+ /**
+ * Method invoked by UIMA framework to initialize this annotator
+ */
+ public void initialize(UimaContext aCtx)
+ throws ResourceInitializationException {
+
+ super.initialize(aCtx);
+
+ try {
+ iv_annotVer = ((Integer) aCtx.getConfigParameterValue("AnnotationVersion")).intValue();
+ iv_annotVerPropKey = (String) aCtx.getConfigParameterValue("AnnotationVersionPropKey");
+ } catch (Exception e) {
+ throw new ResourceInitializationException(e);
+ }
+
+ }
+
+ /**
+ * Method invoked by UIMA framework to process a document
+ */
+ public void process(JCas jcas)
+ throws AnalysisEngineProcessException {
+ generateUidValues(jcas);
+ generateTokenNormForms(jcas);
+ assignNamedEntityFeats(jcas);
+ storeAnnotationVersion(jcas);
+ }
+
+
+ /**
+ * Stores annotation version as a property JCas object.
+ *
+ * @param jcas
+ */
+ private void storeAnnotationVersion(JCas jcas) {
+ FSIterator<TOP> itr = jcas.getJFSIndexRepository().getAllIndexedFS(Pairs.type);
+ if (itr == null || !itr.hasNext())
+ return;
+
+ Pairs props = (Pairs) itr.next();
+
+ // create a new property array that is one item bigger
+ FSArray propArr = props.getPairs();
+ FSArray newPropArr = new FSArray(jcas, propArr.size() + 1);
+ for (int i = 0; i < propArr.size(); i++) {
+ newPropArr.set(i, propArr.get(i));
+ }
+
+ Pair annotVerProp = new Pair(jcas);
+ annotVerProp.setAttribute(iv_annotVerPropKey);
+ annotVerProp.setValue(String.valueOf(iv_annotVer));
+
+ // add annotation version prop as last item in array
+ newPropArr.set(newPropArr.size() - 1, annotVerProp);
+ props.setPairs(newPropArr);
+ }
+
+ /**
+ * Generates UID values for all IdentifiedAnnotation objects.
+ * This is just a numeric identifier, assigned sequentially.
+ */
+ private void generateUidValues(JCas jcas) {
+ int uid = 0;
+ Iterator itr = jcas.getJFSIndexRepository().getAnnotationIndex(
+ IdentifiedAnnotation.type).iterator();
+ while (itr.hasNext()) {
+ IdentifiedAnnotation idAnnot = (IdentifiedAnnotation) itr.next();
+ idAnnot.setId(uid);
+ uid++;
+ }
+ }
+
+ /**
+ * Generates normalized form for each token annotation.
+ * Considers whether it is a <code>WordToken</code> with a canonical form
+ */
+ private void generateTokenNormForms(JCas jcas) {
+ JFSIndexRepository indexes = jcas.getJFSIndexRepository();
+
+ // Determine and set the normalized form for each <code>BaseToken</code>
+ Iterator btaItr = indexes.getAnnotationIndex(BaseToken.type).iterator();
+ while (btaItr.hasNext()) {
+ BaseToken bta = (BaseToken) btaItr.next();
+ String normForm = null;
+ if (!(bta instanceof WordToken)) {
+ normForm = bta.getCoveredText();
+ } else {
+ WordToken wta = (WordToken) bta;
+ String canonicalForm = wta.getCanonicalForm();
+
+
+ // The norm form is the canonical form, if there is one
+ // Otherwise the norm form is the token's text.
+ if ((canonicalForm != null) && (canonicalForm.length() > 0)) {
+ normForm = canonicalForm;
+ } else {
+ normForm = wta.getCoveredText();
+ }
+ }
+ bta.setNormalizedForm(normForm);
+ }
+ }
+
+ /**
+ * Assigns OID and segmentID values to NamedEntities
+ */
+ private void assignNamedEntityFeats(JCas jcas) {
+ JFSIndexRepository indexes = jcas.getJFSIndexRepository();
+ // Set keySet = new HashSet();
+ // List dupList = new ArrayList();
+
+ Set segmentSet = new HashSet();
+ Iterator segmentItr = indexes.getAnnotationIndex(Segment.type).iterator();
+ while (segmentItr.hasNext()) {
+ segmentSet.add(segmentItr.next());
+ }
+
+ // For each NE, assign segment ID and assign ontology concept OIDs if applicable
+ Iterator neItr = indexes.getAnnotationIndex(IdentifiedAnnotation.type).iterator();
+ while (neItr.hasNext()) {
+
+ IdentifiedAnnotation neAnnot = (IdentifiedAnnotation) neItr.next();
+
+ // assign segment ID
+ Iterator segItr = segmentSet.iterator();
+ while (segItr.hasNext()) {
+ Segment seg = (Segment) segItr.next();
+ // see if NE is inside this segment
+ if ((neAnnot.getBegin() >= seg.getBegin())
+ && (neAnnot.getEnd() <= seg.getEnd())) {
+ // found segment for this NE
+ neAnnot.setSegmentID(seg.getId());
+ break;
+ }
+ }
+
+ // assign ontology concept OID values
+ FSArray ocArr = neAnnot.getOntologyConceptArr();
+ if (ocArr != null) {
+ for (int i = 0; i < ocArr.size(); i++) {
+ OntologyConcept oc = (OntologyConcept) ocArr.get(i);
+ String code = oc.getCode();
+ String scheme = oc.getCodingScheme();
+
+ StringBuffer oid = new StringBuffer();
+ oid.append(code);
+ oid.append("#");
+ oid.append(scheme);
+ oc.setOid(oid.toString());
+ }
+ }
+ }
+ }
+}
Modified: incubator/ctakes/branches/SHARPn-cTAKES/common-type-system/src/edu/mayo/bmi/uima/core/type/constants/CONST.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/branches/SHARPn-cTAKES/common-type-system/src/edu/mayo/bmi/uima/core/type/constants/CONST.java?rev=1403989&r1=1403988&r2=1403989&view=diff
==============================================================================
--- incubator/ctakes/branches/SHARPn-cTAKES/common-type-system/src/edu/mayo/bmi/uima/core/type/constants/CONST.java (original)
+++ incubator/ctakes/branches/SHARPn-cTAKES/common-type-system/src/edu/mayo/bmi/uima/core/type/constants/CONST.java Wed Oct 31 05:26:43 2012
@@ -1,212 +1,205 @@
-/*
- * Copyright: (c) 2012 Mayo Foundation for Medical Education and
- * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
- * triple-shield Mayo logo are trademarks and service marks of MFMER.
- *
- * Except as contained in the copyright notice above, or as used to identify
- * MFMER as the author of this software, the trade names, trademarks, service
- * marks, or product names of the copyright holder shall not be used in
- * advertising, promotion or otherwise in connection with this software without
- * prior written authorization of the copyright holder.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.mayo.bmi.uima.core.type.constants;
-/**
- * Contains a set of constants for feature values.
- *
- * @author Mayo
- */
-public class CONST {
-
- public static final int NE_TYPE_ID_UNKNOWN = 0;
- public static final int NE_TYPE_ID_DRUG = 1;
- public static final int NE_TYPE_ID_DISORDER = 2;
- public static final int NE_TYPE_ID_FINDING = 3;
- public static final int NE_TYPE_ID_PROCEDURE = 5;
- public static final int NE_TYPE_ID_ANATOMICAL_SITE = 6;
-
- public static final int MODIFIER_TYPE_ID_UNKNOWN = 0;
- public static final int MODIFIER_TYPE_ID_COURSE_CLASS = 1;
- public static final int MODIFIER_TYPE_ID_SEVERITY_CLASS = 2;
- public static final int MODIFIER_TYPE_ID_LAB_INTERPRETATION_INDICATOR = 3;
-
- public static final int NE_DISCOVERY_TECH_DICT_LOOKUP = 1;
- public static final int NE_DISCOVERY_TECH_GOLD_ANNOTATION = 2;
-
- public static final int NE_POLARITY_NEGATION_ABSENT = 1;
- public static final int NE_POLARITY_NEGATION_PRESENT = -1;
-
- public static final int NE_UNCERTAINTY_PRESENT = 1;
- public static final int NE_UNCERTAINTY_ABSENT = 0;
-
- public static final boolean NE_GENERIC_TRUE = true;
- public static final boolean NE_GENERIC_FALSE = false;
-
- public static final boolean NE_CONDITIONAL_TRUE = true;
- public static final boolean NE_CONDITIONAL_FALSE = false;
-
- public static final int NE_CERTAINTY_POSITIVE = NE_POLARITY_NEGATION_ABSENT; // TO BE DEPRECATED
- public static final int NE_CERTAINTY_NEGATED = NE_POLARITY_NEGATION_PRESENT; // TO BE DEPRECATED
- public static final int NE_DIAG_STATUS_CONFIRMED = 0; // TO BE DEPRECATED
- public static final int NE_DIAG_STATUS_HISTORY_OF = 1; // TO BE DEPRECATED
- public static final int NE_DIAG_STATUS_FAM_HISTORY_OF = 2; // TO BE DEPRECATED
- public static final int NE_DIAG_STATUS_PROBABLE = 3; // TO BE DEPRECATED
-
- public static final String ATTR_SEVERITY_SEVERE = "severe";
- public static final String ATTR_SEVERITY_MODERATE = "moderate";
- public static final String ATTR_SEVERITY_SLIGHT = "slight";
- public static final String ATTR_SEVERITY_UNMARKED = "unmarked";
-
- public static final String ATTR_BODYSIDE_LEFT = "left";
- public static final String ATTR_BODYSIDE_RIGHT = "right";
- public static final String ATTR_BODYSIDE_BILATERAL = "bilateral";
- public static final String ATTR_BODYSIDE_UNMARKED = "unmarked";
-
- public static final String ATTR_BODYLATERALITY_SUPERIOR = "superior"; // Attribute name may change
- public static final String ATTR_BODYLATERALITY_INFERIOR = "inferior"; // Attribute name may change
- public static final String ATTR_BODYLATERALITY_DISTAL = "distal"; // Attribute name may change
- public static final String ATTR_BODYLATERALITY_PROXIMAL = "proximal"; // Attribute name may change
- public static final String ATTR_BODYLATERALITY_MEDIAL = "medial"; // Attribute name may change
- public static final String ATTR_BODYLATERALITY_LATERAL = "lateral"; // Attribute name may change
- public static final String ATTR_BODYLATERALITY_DORSAL = "dorsal"; // Attribute name may change
- public static final String ATTR_BODYLATERALITY_VENTRAL = "ventral"; // Attribute name may change
- public static final String ATTR_BODYLATERALITY_UNMARKED = "unmarked"; // Attribute name may change
-
- public static final String ATTR_HISTORYOF_INDICATOR_PRESENT = "historyOf_present";
- public static final String ATTR_HISTORYOF_INDICATOR_ABSENT = "historyOf_absent";
-
- public static final String ATTR_SUBJECT_PATIENT = "patient";
- public static final String ATTR_SUBJECT_FAMILY_MEMBER = "family_member";
- public static final String ATTR_SUBJECT_DONOR_FAMILY_MEMBER = "donor_family_member";
- public static final String ATTR_SUBJECT_DONOR_OTHER = "donor_other";
- public static final String ATTR_SUBJECT_OTHER = "other";
-
- // ATTR_PROCEDURE_DEVICE -- any string
- // ATTR_PROCEDURE_METHOD -- any string
-
- // ATTR_LAB_VALUE_NUMBER -- any string
- // ATTR_LAB_VALUE_UNIT -- any string
- // ATTR_LAB_REFERENCE_RANGE -- any string
-
- public static final String ATTR_LAB_DELTAFLAG_CHANGEUP = "change_up";
- public static final String ATTR_LAB_DELTAFLAG_CHANGEDOWN = "change_down";
- public static final String ATTR_LAB_DELTAFLAG_NOCHANGE = "no_change";
-
- public static final String ATTR_LAB_ABNORMAL_TRUE = "abnormal";
- public static final String ATTR_LAB_ABNORMAL_VERYTRUE = "very_abnormal";
-
- public static final String ATTR_LAB_ORDINAL_RESISTANT = "resistant";
- public static final String ATTR_LAB_ORDINAL_POSITIVE = "positive";
- public static final String ATTR_LAB_ORDINAL_REACTIVE = "reactive";
- public static final String ATTR_LAB_ORDINAL_INTERMEDIATERESISTANCE = "intermediate_resistance";
- public static final String ATTR_LAB_ORDINAL_INTERMEDIATE = "intermediate";
- public static final String ATTR_LAB_ORDINAL_NEGATIVE = "negative";
- public static final String ATTR_LAB_ORDINAL_NOTDETECTED = "not_detected";
- public static final String ATTR_LAB_ORDINAL_DETECTED = "detected";
- public static final String ATTR_LAB_ORDINAL_WEAKLY_REACTIVE = "weakly_reactive";
- public static final String ATTR_LAB_ORDINAL_MODERATELYSUSCEPTIBLE = "moderately_susceptible";
- public static final String ATTR_LAB_ORDINAL_VERYSUSCEPTIBLE = "very_susceptible";
- public static final String ATTR_LAB_ORDINAL_SUSCEPTIBLE = "susceptible";
- public static final String ATTR_LAB_ORDINAL_1ORMORE = "1+";
- public static final String ATTR_LAB_ORDINAL_2ORMORE = "2+";
- public static final String ATTR_LAB_ORDINAL_3ORMORE = "3+";
- public static final String ATTR_LAB_ORDINAL_4ORMORE = "4+";
- public static final String ATTR_LAB_ORDINAL_SMALL = "small";
- public static final String ATTR_LAB_ORDINAL_TRACE = "trace";
- public static final String ATTR_LAB_ORDINAL_NORMAL = "normal";
- public static final String ATTR_LAB_ORDINAL_NO_OR_NA_RANGE = "no_range_or_normal_range_n/a";
- public static final String ATTR_LAB_ORDINAL_ANTICOMPLEMENTARYPRESENT = "anti_complementary_substance_present";
- public static final String ATTR_LAB_ORDINAL_CYTOTOXICPRESENT = "cytotoxic_substance_present";
- public static final String ATTR_LAB_ORDINAL_QUALITYCONTROLFAIL = "quality_control_failure";
-
- public static final boolean ATTR_LAB_ESTIMATED_FLAG_TRUE = true;
- public static final boolean ATTR_LAB_ESTIMATED_FLAG_FALSE = false;
-
- public static final String ATTR_MEDICATION_DOSAGE_1 = "1";
- public static final String ATTR_MEDICATION_DOSAGE_2 = "2";
- public static final String ATTR_MEDICATION_DOSAGE_3 = "3";
- public static final String ATTR_MEDICATION_DOSAGE_4 = "4";
- public static final String ATTR_MEDICATION_DOSAGE_5 = "5";
- public static final String ATTR_MEDICATION_DOSAGE_UNDETERMINED = "undetermined";
- public static final String ATTR_MEDICATION_DOSAGE_OTHER = "other";
-
- public static final String ATTR_MEDICATION_ROUTE_TOPICAL = "topical";
- public static final String ATTR_MEDICATION_ROUTE_ENTERAL_ORAL = "oral";
- public static final String ATTR_MEDICATION_ROUTE_ENTERAL_GASTRIC = "gastric";
- public static final String ATTR_MEDICATION_ROUTE_ENTERAL_RECTAL = "rectal";
- public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_INTRAVENOUS = "intravenous";
- public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_INTRAARTERIAL = "intra-arterial";
- public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_INTRAMUSCULAR = "intramuscular";
- public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_INTRACARDIAC = "intracardiac";
- public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_SUBCUTANEOUS = "subcutaneous";
- public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_INTRATHECAL = "intrathecal";
- public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_INTRAPERIOTONEAL = "intraperiotoneal";
- public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_TRANSDERMAL = "transdermal";
- public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_TRANSMUCOSAL = "transmucosal";
- public static final String ATTR_MEDICATION_ROUTE_OTHER = "other";
- public static final String ATTR_MEDICATION_ROUTE_UNDETERMINED = "undetermined";
-
- public static final String ATTR_MEDICATION_FORM_AEROSOL = "aerosol";
- public static final String ATTR_MEDICATION_FORM_CAPSULE = "capsule";
- public static final String ATTR_MEDICATION_FORM_CREAM = "cream";
- public static final String ATTR_MEDICATION_FORM_ELIXIR = "elixir";
- public static final String ATTR_MEDICATION_FORM_EMULSION = "emulsion";
- public static final String ATTR_MEDICATION_FORM_ENEMA = "enema";
- public static final String ATTR_MEDICATION_FORM_GEL = "gel";
- public static final String ATTR_MEDICATION_FORM_IMPLANT = "implant";
- public static final String ATTR_MEDICATION_FORM_INHALANT = "inhalant";
- public static final String ATTR_MEDICATION_FORM_INJECTION = "injection";
- public static final String ATTR_MEDICATION_FORM_LIQUID = "liquid";
- public static final String ATTR_MEDICATION_FORM_LOTION = "lotion";
- public static final String ATTR_MEDICATION_FORM_LOZENGE = "lozenge";
- public static final String ATTR_MEDICATION_FORM_OINTMENT = "ointment";
- public static final String ATTR_MEDICATION_FORM_PATCH = "patch";
- public static final String ATTR_MEDICATION_FORM_PELLET = "pellet";
- public static final String ATTR_MEDICATION_FORM_PILL = "pill";
- public static final String ATTR_MEDICATION_FORM_POWDER = "powder";
- public static final String ATTR_MEDICATION_FORM_SHAMPOO = "shampoo";
- public static final String ATTR_MEDICATION_FORM_SOAP = "soap";
- public static final String ATTR_MEDICATION_FORM_SOLUTION = "solution";
- public static final String ATTR_MEDICATION_FORM_SPRAY = "spray";
- public static final String ATTR_MEDICATION_FORM_SUPPOSITORY = "suppository";
- public static final String ATTR_MEDICATION_FORM_SYRUP = "syrup";
- public static final String ATTR_MEDICATION_FORM_TABLET = "tablet";
- public static final String ATTR_MEDICATION_FORM_OTHER = "other";
-
- public static final String ATTR_MEDICATION_STATUSCHANGE_START = "start";
- public static final String ATTR_MEDICATION_STATUSCHANGE_STOP = "stop";
- public static final String ATTR_MEDICATION_STATUSCHANGE_INCREASE = "increase";
- public static final String ATTR_MEDICATION_STATUSCHANGE_DECREASE = "decrease";
- public static final String ATTR_MEDICATION_STATUSCHANGE_NOCHANGE = "noChange";
-
- public static final String ATTR_MEDICATION_ALLERGY_INDICATOR_PRESENT = "allergy_present";
- public static final String ATTR_MEDICATION_ALLERGY_INDICATOR_ABSENT = "allergy_absent";
-
- // ATTR_MEDICATION_STRENGTH is any number/unit pair
- // ATTR_MEDICATION_DURATION is any string
- // ATTR_MEDICATION_FREQUENCY is any number/unit pair
-
- public static final int REL_DISCOVERY_TECH_GOLD_ANNOTATION = 1;
-
- public static final String MED_STATUS_CHANGE_START = ATTR_MEDICATION_STATUSCHANGE_START; // TO BE DEPRECATED
- public static final String MED_STATUS_CHANGE_STOP = ATTR_MEDICATION_STATUSCHANGE_STOP; // TO BE DEPRECATED
- public static final String MED_STATUS_CHANGE_INCREASEFROM = "increasefrom"; // TO BE DEPRECATED
- public static final String MED_STATUS_CHANGE_DECREASEFROM = "decreasefrom"; // TO BE DEPRECATED
- public static final String MED_STATUS_CHANGE_INCREASE = ATTR_MEDICATION_STATUSCHANGE_INCREASE; // TO BE DEPRECATED
- public static final String MED_STATUS_CHANGE_DECREASE = ATTR_MEDICATION_STATUSCHANGE_DECREASE; // TO BE DEPRECATED
- public static final String MED_STATUS_CHANGE_NOCHANGE = ATTR_MEDICATION_STATUSCHANGE_NOCHANGE; // TO BE DEPRECATED
- public static final String MED_STATUS_CHANGE_SUM = "add"; // TO BE DEPRECATED
- public static final String MED_STATUS_CHANGE_MAX = "maximum"; // TO BE DEPRECATED
- public static final String MED_STATUS_CHANGE_OTHER = "change"; // TO BE DEPRECATED
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.mayo.bmi.uima.core.type.constants;
+/**
+ * Contains a set of constants for feature values.
+ *
+ * @author Mayo
+ */
+public class CONST {
+
+ public static final int NE_TYPE_ID_UNKNOWN = 0;
+ public static final int NE_TYPE_ID_DRUG = 1;
+ public static final int NE_TYPE_ID_DISORDER = 2;
+ public static final int NE_TYPE_ID_FINDING = 3;
+ public static final int NE_TYPE_ID_PROCEDURE = 5;
+ public static final int NE_TYPE_ID_ANATOMICAL_SITE = 6;
+
+ public static final int MODIFIER_TYPE_ID_UNKNOWN = 0;
+ public static final int MODIFIER_TYPE_ID_COURSE_CLASS = 1;
+ public static final int MODIFIER_TYPE_ID_SEVERITY_CLASS = 2;
+ public static final int MODIFIER_TYPE_ID_LAB_INTERPRETATION_INDICATOR = 3;
+
+ public static final int NE_DISCOVERY_TECH_DICT_LOOKUP = 1;
+ public static final int NE_DISCOVERY_TECH_GOLD_ANNOTATION = 2;
+
+ public static final int NE_POLARITY_NEGATION_ABSENT = 1;
+ public static final int NE_POLARITY_NEGATION_PRESENT = -1;
+
+ public static final int NE_UNCERTAINTY_PRESENT = 1;
+ public static final int NE_UNCERTAINTY_ABSENT = 0;
+
+ public static final boolean NE_GENERIC_TRUE = true;
+ public static final boolean NE_GENERIC_FALSE = false;
+
+ public static final boolean NE_CONDITIONAL_TRUE = true;
+ public static final boolean NE_CONDITIONAL_FALSE = false;
+
+ public static final int NE_CERTAINTY_POSITIVE = NE_POLARITY_NEGATION_ABSENT; // TO BE DEPRECATED
+ public static final int NE_CERTAINTY_NEGATED = NE_POLARITY_NEGATION_PRESENT; // TO BE DEPRECATED
+ public static final int NE_DIAG_STATUS_CONFIRMED = 0; // TO BE DEPRECATED
+ public static final int NE_DIAG_STATUS_HISTORY_OF = 1; // TO BE DEPRECATED
+ public static final int NE_DIAG_STATUS_FAM_HISTORY_OF = 2; // TO BE DEPRECATED
+ public static final int NE_DIAG_STATUS_PROBABLE = 3; // TO BE DEPRECATED
+
+ public static final String ATTR_SEVERITY_SEVERE = "severe";
+ public static final String ATTR_SEVERITY_MODERATE = "moderate";
+ public static final String ATTR_SEVERITY_SLIGHT = "slight";
+ public static final String ATTR_SEVERITY_UNMARKED = "unmarked";
+
+ public static final String ATTR_BODYSIDE_LEFT = "left";
+ public static final String ATTR_BODYSIDE_RIGHT = "right";
+ public static final String ATTR_BODYSIDE_BILATERAL = "bilateral";
+ public static final String ATTR_BODYSIDE_UNMARKED = "unmarked";
+
+ public static final String ATTR_BODYLATERALITY_SUPERIOR = "superior"; // Attribute name may change
+ public static final String ATTR_BODYLATERALITY_INFERIOR = "inferior"; // Attribute name may change
+ public static final String ATTR_BODYLATERALITY_DISTAL = "distal"; // Attribute name may change
+ public static final String ATTR_BODYLATERALITY_PROXIMAL = "proximal"; // Attribute name may change
+ public static final String ATTR_BODYLATERALITY_MEDIAL = "medial"; // Attribute name may change
+ public static final String ATTR_BODYLATERALITY_LATERAL = "lateral"; // Attribute name may change
+ public static final String ATTR_BODYLATERALITY_DORSAL = "dorsal"; // Attribute name may change
+ public static final String ATTR_BODYLATERALITY_VENTRAL = "ventral"; // Attribute name may change
+ public static final String ATTR_BODYLATERALITY_UNMARKED = "unmarked"; // Attribute name may change
+
+ public static final String ATTR_HISTORYOF_INDICATOR_PRESENT = "historyOf_present";
+ public static final String ATTR_HISTORYOF_INDICATOR_ABSENT = "historyOf_absent";
+
+ public static final String ATTR_SUBJECT_PATIENT = "patient";
+ public static final String ATTR_SUBJECT_FAMILY_MEMBER = "family_member";
+ public static final String ATTR_SUBJECT_DONOR_FAMILY_MEMBER = "donor_family_member";
+ public static final String ATTR_SUBJECT_DONOR_OTHER = "donor_other";
+ public static final String ATTR_SUBJECT_OTHER = "other";
+
+ // ATTR_PROCEDURE_DEVICE -- any string
+ // ATTR_PROCEDURE_METHOD -- any string
+
+ // ATTR_LAB_VALUE_NUMBER -- any string
+ // ATTR_LAB_VALUE_UNIT -- any string
+ // ATTR_LAB_REFERENCE_RANGE -- any string
+
+ public static final String ATTR_LAB_DELTAFLAG_CHANGEUP = "change_up";
+ public static final String ATTR_LAB_DELTAFLAG_CHANGEDOWN = "change_down";
+ public static final String ATTR_LAB_DELTAFLAG_NOCHANGE = "no_change";
+
+ public static final String ATTR_LAB_ABNORMAL_TRUE = "abnormal";
+ public static final String ATTR_LAB_ABNORMAL_VERYTRUE = "very_abnormal";
+
+ public static final String ATTR_LAB_ORDINAL_RESISTANT = "resistant";
+ public static final String ATTR_LAB_ORDINAL_POSITIVE = "positive";
+ public static final String ATTR_LAB_ORDINAL_REACTIVE = "reactive";
+ public static final String ATTR_LAB_ORDINAL_INTERMEDIATERESISTANCE = "intermediate_resistance";
+ public static final String ATTR_LAB_ORDINAL_INTERMEDIATE = "intermediate";
+ public static final String ATTR_LAB_ORDINAL_NEGATIVE = "negative";
+ public static final String ATTR_LAB_ORDINAL_NOTDETECTED = "not_detected";
+ public static final String ATTR_LAB_ORDINAL_DETECTED = "detected";
+ public static final String ATTR_LAB_ORDINAL_WEAKLY_REACTIVE = "weakly_reactive";
+ public static final String ATTR_LAB_ORDINAL_MODERATELYSUSCEPTIBLE = "moderately_susceptible";
+ public static final String ATTR_LAB_ORDINAL_VERYSUSCEPTIBLE = "very_susceptible";
+ public static final String ATTR_LAB_ORDINAL_SUSCEPTIBLE = "susceptible";
+ public static final String ATTR_LAB_ORDINAL_1ORMORE = "1+";
+ public static final String ATTR_LAB_ORDINAL_2ORMORE = "2+";
+ public static final String ATTR_LAB_ORDINAL_3ORMORE = "3+";
+ public static final String ATTR_LAB_ORDINAL_4ORMORE = "4+";
+ public static final String ATTR_LAB_ORDINAL_SMALL = "small";
+ public static final String ATTR_LAB_ORDINAL_TRACE = "trace";
+ public static final String ATTR_LAB_ORDINAL_NORMAL = "normal";
+ public static final String ATTR_LAB_ORDINAL_NO_OR_NA_RANGE = "no_range_or_normal_range_n/a";
+ public static final String ATTR_LAB_ORDINAL_ANTICOMPLEMENTARYPRESENT = "anti_complementary_substance_present";
+ public static final String ATTR_LAB_ORDINAL_CYTOTOXICPRESENT = "cytotoxic_substance_present";
+ public static final String ATTR_LAB_ORDINAL_QUALITYCONTROLFAIL = "quality_control_failure";
+
+ public static final boolean ATTR_LAB_ESTIMATED_FLAG_TRUE = true;
+ public static final boolean ATTR_LAB_ESTIMATED_FLAG_FALSE = false;
+
+ public static final String ATTR_MEDICATION_DOSAGE_1 = "1";
+ public static final String ATTR_MEDICATION_DOSAGE_2 = "2";
+ public static final String ATTR_MEDICATION_DOSAGE_3 = "3";
+ public static final String ATTR_MEDICATION_DOSAGE_4 = "4";
+ public static final String ATTR_MEDICATION_DOSAGE_5 = "5";
+ public static final String ATTR_MEDICATION_DOSAGE_UNDETERMINED = "undetermined";
+ public static final String ATTR_MEDICATION_DOSAGE_OTHER = "other";
+
+ public static final String ATTR_MEDICATION_ROUTE_TOPICAL = "topical";
+ public static final String ATTR_MEDICATION_ROUTE_ENTERAL_ORAL = "oral";
+ public static final String ATTR_MEDICATION_ROUTE_ENTERAL_GASTRIC = "gastric";
+ public static final String ATTR_MEDICATION_ROUTE_ENTERAL_RECTAL = "rectal";
+ public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_INTRAVENOUS = "intravenous";
+ public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_INTRAARTERIAL = "intra-arterial";
+ public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_INTRAMUSCULAR = "intramuscular";
+ public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_INTRACARDIAC = "intracardiac";
+ public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_SUBCUTANEOUS = "subcutaneous";
+ public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_INTRATHECAL = "intrathecal";
+ public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_INTRAPERIOTONEAL = "intraperiotoneal";
+ public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_TRANSDERMAL = "transdermal";
+ public static final String ATTR_MEDICATION_ROUTE_PARENTERAL_TRANSMUCOSAL = "transmucosal";
+ public static final String ATTR_MEDICATION_ROUTE_OTHER = "other";
+ public static final String ATTR_MEDICATION_ROUTE_UNDETERMINED = "undetermined";
+
+ public static final String ATTR_MEDICATION_FORM_AEROSOL = "aerosol";
+ public static final String ATTR_MEDICATION_FORM_CAPSULE = "capsule";
+ public static final String ATTR_MEDICATION_FORM_CREAM = "cream";
+ public static final String ATTR_MEDICATION_FORM_ELIXIR = "elixir";
+ public static final String ATTR_MEDICATION_FORM_EMULSION = "emulsion";
+ public static final String ATTR_MEDICATION_FORM_ENEMA = "enema";
+ public static final String ATTR_MEDICATION_FORM_GEL = "gel";
+ public static final String ATTR_MEDICATION_FORM_IMPLANT = "implant";
+ public static final String ATTR_MEDICATION_FORM_INHALANT = "inhalant";
+ public static final String ATTR_MEDICATION_FORM_INJECTION = "injection";
+ public static final String ATTR_MEDICATION_FORM_LIQUID = "liquid";
+ public static final String ATTR_MEDICATION_FORM_LOTION = "lotion";
+ public static final String ATTR_MEDICATION_FORM_LOZENGE = "lozenge";
+ public static final String ATTR_MEDICATION_FORM_OINTMENT = "ointment";
+ public static final String ATTR_MEDICATION_FORM_PATCH = "patch";
+ public static final String ATTR_MEDICATION_FORM_PELLET = "pellet";
+ public static final String ATTR_MEDICATION_FORM_PILL = "pill";
+ public static final String ATTR_MEDICATION_FORM_POWDER = "powder";
+ public static final String ATTR_MEDICATION_FORM_SHAMPOO = "shampoo";
+ public static final String ATTR_MEDICATION_FORM_SOAP = "soap";
+ public static final String ATTR_MEDICATION_FORM_SOLUTION = "solution";
+ public static final String ATTR_MEDICATION_FORM_SPRAY = "spray";
+ public static final String ATTR_MEDICATION_FORM_SUPPOSITORY = "suppository";
+ public static final String ATTR_MEDICATION_FORM_SYRUP = "syrup";
+ public static final String ATTR_MEDICATION_FORM_TABLET = "tablet";
+ public static final String ATTR_MEDICATION_FORM_OTHER = "other";
+
+ public static final String ATTR_MEDICATION_STATUSCHANGE_START = "start";
+ public static final String ATTR_MEDICATION_STATUSCHANGE_STOP = "stop";
+ public static final String ATTR_MEDICATION_STATUSCHANGE_INCREASE = "increase";
+ public static final String ATTR_MEDICATION_STATUSCHANGE_DECREASE = "decrease";
+ public static final String ATTR_MEDICATION_STATUSCHANGE_NOCHANGE = "noChange";
+
+ public static final String ATTR_MEDICATION_ALLERGY_INDICATOR_PRESENT = "allergy_present";
+ public static final String ATTR_MEDICATION_ALLERGY_INDICATOR_ABSENT = "allergy_absent";
+
+ // ATTR_MEDICATION_STRENGTH is any number/unit pair
+ // ATTR_MEDICATION_DURATION is any string
+ // ATTR_MEDICATION_FREQUENCY is any number/unit pair
+
+ public static final int REL_DISCOVERY_TECH_GOLD_ANNOTATION = 1;
+
+ public static final String MED_STATUS_CHANGE_START = ATTR_MEDICATION_STATUSCHANGE_START; // TO BE DEPRECATED
+ public static final String MED_STATUS_CHANGE_STOP = ATTR_MEDICATION_STATUSCHANGE_STOP; // TO BE DEPRECATED
+ public static final String MED_STATUS_CHANGE_INCREASEFROM = "increasefrom"; // TO BE DEPRECATED
+ public static final String MED_STATUS_CHANGE_DECREASEFROM = "decreasefrom"; // TO BE DEPRECATED
+ public static final String MED_STATUS_CHANGE_INCREASE = ATTR_MEDICATION_STATUSCHANGE_INCREASE; // TO BE DEPRECATED
+ public static final String MED_STATUS_CHANGE_DECREASE = ATTR_MEDICATION_STATUSCHANGE_DECREASE; // TO BE DEPRECATED
+ public static final String MED_STATUS_CHANGE_NOCHANGE = ATTR_MEDICATION_STATUSCHANGE_NOCHANGE; // TO BE DEPRECATED
+ public static final String MED_STATUS_CHANGE_SUM = "add"; // TO BE DEPRECATED
+ public static final String MED_STATUS_CHANGE_MAX = "maximum"; // TO BE DEPRECATED
+ public static final String MED_STATUS_CHANGE_OTHER = "change"; // TO BE DEPRECATED
+}
Modified: incubator/ctakes/branches/SHARPn-cTAKES/context dependent tokenizer/src/edu/mayo/bmi/uima/cdt/ae/ContextDependentTokenizerAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/branches/SHARPn-cTAKES/context%20dependent%20tokenizer/src/edu/mayo/bmi/uima/cdt/ae/ContextDependentTokenizerAnnotator.java?rev=1403989&r1=1403988&r2=1403989&view=diff
==============================================================================
--- incubator/ctakes/branches/SHARPn-cTAKES/context dependent tokenizer/src/edu/mayo/bmi/uima/cdt/ae/ContextDependentTokenizerAnnotator.java (original)
+++ incubator/ctakes/branches/SHARPn-cTAKES/context dependent tokenizer/src/edu/mayo/bmi/uima/cdt/ae/ContextDependentTokenizerAnnotator.java Wed Oct 31 05:26:43 2012
@@ -1,18 +1,11 @@
/*
- * Copyright: (c) 2009 Mayo Foundation for Medical Education and
- * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
- * triple-shield Mayo logo are trademarks and service marks of MFMER.
- *
- * Except as contained in the copyright notice above, or as used to identify
- * MFMER as the author of this software, the trade names, trademarks, service
- * marks, or product names of the copyright holder shall not be used in
- * advertising, promotion or otherwise in connection with this software without
- * prior written authorization of the copyright holder.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@@ -21,8 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.mayo.bmi.uima.cdt.ae;
-
+package edu.mayo.bmi.uima.cdt.ae;
+
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -75,163 +68,163 @@ import edu.mayo.bmi.uima.core.type.texts
import edu.mayo.bmi.uima.core.type.textsem.RomanNumeralAnnotation;
import edu.mayo.bmi.uima.core.type.textsem.TimeAnnotation;
import edu.mayo.bmi.uima.core.type.textspan.Sentence;
-
-/**
- * Finds tokens based on context.
- *
- * @author Mayo Clinic
- */
-public class ContextDependentTokenizerAnnotator extends JCasAnnotator_ImplBase {
- // LOG4J logger based on class name
- private Logger iv_logger = Logger.getLogger(getClass().getName());
-
- private DateFSM iv_dateFSM;
- private TimeFSM iv_timeFSM;
- private FractionFSM iv_fractionFSM;
- private RomanNumeralFSM iv_romanNumeralFSM;
- private RangeFSM iv_rangeFSM;
- private MeasurementFSM iv_measurementFSM;
- private PersonTitleFSM iv_personTitleFSM;
-
- public void initialize(UimaContext annotCtx) throws ResourceInitializationException {
- super.initialize(annotCtx);
-
- iv_dateFSM = new DateFSM();
- iv_timeFSM = new TimeFSM();
- iv_fractionFSM = new FractionFSM();
- iv_romanNumeralFSM = new RomanNumeralFSM();
- iv_rangeFSM = new RangeFSM();
- iv_measurementFSM = new MeasurementFSM();
- iv_personTitleFSM = new PersonTitleFSM();
- iv_logger.info("Finite state machines loaded.");
- }
-
- public void process(JCas jcas) throws AnalysisEngineProcessException {
-
- try {
-
- iv_logger.info("process(JCas)");
-
- JFSIndexRepository indexes = jcas.getJFSIndexRepository();
- Iterator<?> sentItr = indexes.getAnnotationIndex(Sentence.type).iterator();
- AnnotationIndex baseTokenIndex = jcas.getJFSIndexRepository().getAnnotationIndex(
- edu.mayo.bmi.uima.core.type.syntax.BaseToken.type);
-
- while (sentItr.hasNext()) {
- Sentence sentAnnot = (Sentence) sentItr.next();
- FSIterator btaItr = baseTokenIndex.subiterator(sentAnnot);
-
- // adapt JCas objects into objects expected by the Finite state
- // machines
- List<BaseToken> baseTokenList = new ArrayList<BaseToken>();
- while (btaItr.hasNext()) {
- edu.mayo.bmi.uima.core.type.syntax.BaseToken bta = (edu.mayo.bmi.uima.core.type.syntax.BaseToken) btaItr
- .next();
- baseTokenList.add(adaptToBaseToken(bta));
- }
-
- // execute FSM logic
- executeFSMs(jcas, baseTokenList);
- }
- } catch (Exception e) {
- throw new AnalysisEngineProcessException(e);
- }
- }
-
- private void executeFSMs(JCas jcas, List<? extends BaseToken> baseTokenList) throws AnalysisEngineProcessException {
- try {
- Set<DateToken> dateTokenSet = iv_dateFSM.execute(baseTokenList);
- Iterator<DateToken> dateTokenItr = dateTokenSet.iterator();
- while (dateTokenItr.hasNext()) {
- DateToken dt = dateTokenItr.next();
- DateAnnotation dta = new DateAnnotation(jcas, dt.getStartOffset(), dt.getEndOffset());
- dta.addToIndexes();
- }
-
- Set<TimeToken> timeTokenSet = iv_timeFSM.execute(baseTokenList);
- Iterator<TimeToken> timeTokenItr = timeTokenSet.iterator();
- while (timeTokenItr.hasNext()) {
- TimeToken tt = timeTokenItr.next();
- TimeAnnotation ta = new TimeAnnotation(jcas, tt.getStartOffset(), tt.getEndOffset());
- ta.addToIndexes();
- }
-
- Set<RomanNumeralToken> romanNumeralTokenSet = iv_romanNumeralFSM.execute(baseTokenList);
- Iterator<RomanNumeralToken> romanNumeralTokenItr = romanNumeralTokenSet.iterator();
- while (romanNumeralTokenItr.hasNext()) {
- RomanNumeralToken rnt = romanNumeralTokenItr.next();
- RomanNumeralAnnotation rna = new RomanNumeralAnnotation(jcas, rnt.getStartOffset(), rnt.getEndOffset());
- rna.addToIndexes();
- }
-
- Set<FractionToken> fractionTokenSet = iv_fractionFSM.execute(baseTokenList);
- Iterator<FractionToken> fractionTokenItr = fractionTokenSet.iterator();
- while (fractionTokenItr.hasNext()) {
- FractionToken ft = fractionTokenItr.next();
- FractionAnnotation fa = new FractionAnnotation(jcas, ft.getStartOffset(), ft.getEndOffset());
- fa.addToIndexes();
- }
-
- Set<RangeToken> rangeTokenSet = iv_rangeFSM.execute(baseTokenList, romanNumeralTokenSet);
- Iterator<RangeToken> rangeTokenItr = rangeTokenSet.iterator();
- while (rangeTokenItr.hasNext()) {
- RangeToken rt = rangeTokenItr.next();
- RangeAnnotation ra = new RangeAnnotation(jcas, rt.getStartOffset(), rt.getEndOffset());
- ra.addToIndexes();
- }
-
- Set<MeasurementToken> measurementTokenSet = iv_measurementFSM.execute(baseTokenList, rangeTokenSet);
- Iterator<MeasurementToken> measurementTokenItr = measurementTokenSet.iterator();
- while (measurementTokenItr.hasNext()) {
- MeasurementToken mt = measurementTokenItr.next();
- MeasurementAnnotation ma = new MeasurementAnnotation(jcas, mt.getStartOffset(), mt.getEndOffset());
- ma.addToIndexes();
- }
-
- Set<PersonTitleToken> personTitleTokenSet = iv_personTitleFSM.execute(baseTokenList);
- Iterator<PersonTitleToken> personTitleTokenItr = personTitleTokenSet.iterator();
- while (personTitleTokenItr.hasNext()) {
- PersonTitleToken ptt = personTitleTokenItr.next();
- PersonTitleAnnotation pta = new PersonTitleAnnotation(jcas, ptt.getStartOffset(), ptt.getEndOffset());
- pta.addToIndexes();
- }
- } catch (Exception e) {
- throw new AnalysisEngineProcessException(e);
- }
- }
-
- /**
- * Adapts JCas objects to BaseToken interfaces expected by the Finite State
- * Machines.
- *
- * @param obj
- * @return
- */
- private BaseToken adaptToBaseToken(edu.mayo.bmi.uima.core.type.syntax.BaseToken obj) throws Exception {
- if (obj instanceof WordToken) {
- WordToken wta = (WordToken) obj;
- return new WordTokenAdapter(wta);
- } else if (obj instanceof NumToken) {
- NumToken nta = (NumToken) obj;
- if (nta.getNumType() == TokenizerAnnotator.TOKEN_NUM_TYPE_INTEGER) {
- return new IntegerTokenAdapter(nta);
- } else {
- return new DecimalTokenAdapter(nta);
- }
- } else if (obj instanceof PunctuationToken) {
- PunctuationToken pta = (PunctuationToken) obj;
- return new PunctuationTokenAdapter(pta);
- } else if (obj instanceof NewlineToken) {
- NewlineToken nta = (NewlineToken) obj;
- return new NewlineTokenAdapter(nta);
- } else if (obj instanceof ContractionToken) {
- ContractionToken cta = (ContractionToken) obj;
- return new ContractionTokenAdapter(cta);
- } else if (obj instanceof SymbolToken) {
- SymbolToken sta = (SymbolToken) obj;
- return new SymbolTokenAdapter(sta);
- }
-
- throw new Exception("No Context Dependent Tokenizer adapter for class: " + obj.getClass());
- }
-}
+
+/**
+ * Finds tokens based on context.
+ *
+ * @author Mayo Clinic
+ */
+public class ContextDependentTokenizerAnnotator extends JCasAnnotator_ImplBase {
+ // LOG4J logger based on class name
+ private Logger iv_logger = Logger.getLogger(getClass().getName());
+
+ private DateFSM iv_dateFSM;
+ private TimeFSM iv_timeFSM;
+ private FractionFSM iv_fractionFSM;
+ private RomanNumeralFSM iv_romanNumeralFSM;
+ private RangeFSM iv_rangeFSM;
+ private MeasurementFSM iv_measurementFSM;
+ private PersonTitleFSM iv_personTitleFSM;
+
+ public void initialize(UimaContext annotCtx) throws ResourceInitializationException {
+ super.initialize(annotCtx);
+
+ iv_dateFSM = new DateFSM();
+ iv_timeFSM = new TimeFSM();
+ iv_fractionFSM = new FractionFSM();
+ iv_romanNumeralFSM = new RomanNumeralFSM();
+ iv_rangeFSM = new RangeFSM();
+ iv_measurementFSM = new MeasurementFSM();
+ iv_personTitleFSM = new PersonTitleFSM();
+ iv_logger.info("Finite state machines loaded.");
+ }
+
+ public void process(JCas jcas) throws AnalysisEngineProcessException {
+
+ try {
+
+ iv_logger.info("process(JCas)");
+
+ JFSIndexRepository indexes = jcas.getJFSIndexRepository();
+ Iterator<?> sentItr = indexes.getAnnotationIndex(Sentence.type).iterator();
+ AnnotationIndex baseTokenIndex = jcas.getJFSIndexRepository().getAnnotationIndex(
+ edu.mayo.bmi.uima.core.type.syntax.BaseToken.type);
+
+ while (sentItr.hasNext()) {
+ Sentence sentAnnot = (Sentence) sentItr.next();
+ FSIterator btaItr = baseTokenIndex.subiterator(sentAnnot);
+
+ // adapt JCas objects into objects expected by the Finite state
+ // machines
+ List<BaseToken> baseTokenList = new ArrayList<BaseToken>();
+ while (btaItr.hasNext()) {
+ edu.mayo.bmi.uima.core.type.syntax.BaseToken bta = (edu.mayo.bmi.uima.core.type.syntax.BaseToken) btaItr
+ .next();
+ baseTokenList.add(adaptToBaseToken(bta));
+ }
+
+ // execute FSM logic
+ executeFSMs(jcas, baseTokenList);
+ }
+ } catch (Exception e) {
+ throw new AnalysisEngineProcessException(e);
+ }
+ }
+
+ private void executeFSMs(JCas jcas, List<? extends BaseToken> baseTokenList) throws AnalysisEngineProcessException {
+ try {
+ Set<DateToken> dateTokenSet = iv_dateFSM.execute(baseTokenList);
+ Iterator<DateToken> dateTokenItr = dateTokenSet.iterator();
+ while (dateTokenItr.hasNext()) {
+ DateToken dt = dateTokenItr.next();
+ DateAnnotation dta = new DateAnnotation(jcas, dt.getStartOffset(), dt.getEndOffset());
+ dta.addToIndexes();
+ }
+
+ Set<TimeToken> timeTokenSet = iv_timeFSM.execute(baseTokenList);
+ Iterator<TimeToken> timeTokenItr = timeTokenSet.iterator();
+ while (timeTokenItr.hasNext()) {
+ TimeToken tt = timeTokenItr.next();
+ TimeAnnotation ta = new TimeAnnotation(jcas, tt.getStartOffset(), tt.getEndOffset());
+ ta.addToIndexes();
+ }
+
+ Set<RomanNumeralToken> romanNumeralTokenSet = iv_romanNumeralFSM.execute(baseTokenList);
+ Iterator<RomanNumeralToken> romanNumeralTokenItr = romanNumeralTokenSet.iterator();
+ while (romanNumeralTokenItr.hasNext()) {
+ RomanNumeralToken rnt = romanNumeralTokenItr.next();
+ RomanNumeralAnnotation rna = new RomanNumeralAnnotation(jcas, rnt.getStartOffset(), rnt.getEndOffset());
+ rna.addToIndexes();
+ }
+
+ Set<FractionToken> fractionTokenSet = iv_fractionFSM.execute(baseTokenList);
+ Iterator<FractionToken> fractionTokenItr = fractionTokenSet.iterator();
+ while (fractionTokenItr.hasNext()) {
+ FractionToken ft = fractionTokenItr.next();
+ FractionAnnotation fa = new FractionAnnotation(jcas, ft.getStartOffset(), ft.getEndOffset());
+ fa.addToIndexes();
+ }
+
+ Set<RangeToken> rangeTokenSet = iv_rangeFSM.execute(baseTokenList, romanNumeralTokenSet);
+ Iterator<RangeToken> rangeTokenItr = rangeTokenSet.iterator();
+ while (rangeTokenItr.hasNext()) {
+ RangeToken rt = rangeTokenItr.next();
+ RangeAnnotation ra = new RangeAnnotation(jcas, rt.getStartOffset(), rt.getEndOffset());
+ ra.addToIndexes();
+ }
+
+ Set<MeasurementToken> measurementTokenSet = iv_measurementFSM.execute(baseTokenList, rangeTokenSet);
+ Iterator<MeasurementToken> measurementTokenItr = measurementTokenSet.iterator();
+ while (measurementTokenItr.hasNext()) {
+ MeasurementToken mt = measurementTokenItr.next();
+ MeasurementAnnotation ma = new MeasurementAnnotation(jcas, mt.getStartOffset(), mt.getEndOffset());
+ ma.addToIndexes();
+ }
+
+ Set<PersonTitleToken> personTitleTokenSet = iv_personTitleFSM.execute(baseTokenList);
+ Iterator<PersonTitleToken> personTitleTokenItr = personTitleTokenSet.iterator();
+ while (personTitleTokenItr.hasNext()) {
+ PersonTitleToken ptt = personTitleTokenItr.next();
+ PersonTitleAnnotation pta = new PersonTitleAnnotation(jcas, ptt.getStartOffset(), ptt.getEndOffset());
+ pta.addToIndexes();
+ }
+ } catch (Exception e) {
+ throw new AnalysisEngineProcessException(e);
+ }
+ }
+
+ /**
+ * Adapts JCas objects to BaseToken interfaces expected by the Finite State
+ * Machines.
+ *
+ * @param obj
+ * @return
+ */
+ private BaseToken adaptToBaseToken(edu.mayo.bmi.uima.core.type.syntax.BaseToken obj) throws Exception {
+ if (obj instanceof WordToken) {
+ WordToken wta = (WordToken) obj;
+ return new WordTokenAdapter(wta);
+ } else if (obj instanceof NumToken) {
+ NumToken nta = (NumToken) obj;
+ if (nta.getNumType() == TokenizerAnnotator.TOKEN_NUM_TYPE_INTEGER) {
+ return new IntegerTokenAdapter(nta);
+ } else {
+ return new DecimalTokenAdapter(nta);
+ }
+ } else if (obj instanceof PunctuationToken) {
+ PunctuationToken pta = (PunctuationToken) obj;
+ return new PunctuationTokenAdapter(pta);
+ } else if (obj instanceof NewlineToken) {
+ NewlineToken nta = (NewlineToken) obj;
+ return new NewlineTokenAdapter(nta);
+ } else if (obj instanceof ContractionToken) {
+ ContractionToken cta = (ContractionToken) obj;
+ return new ContractionTokenAdapter(cta);
+ } else if (obj instanceof SymbolToken) {
+ SymbolToken sta = (SymbolToken) obj;
+ return new SymbolTokenAdapter(sta);
+ }
+
+ throw new Exception("No Context Dependent Tokenizer adapter for class: " + obj.getClass());
+ }
+}
Modified: incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/CombineCondition.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/CombineCondition.java?rev=1403989&r1=1403988&r2=1403989&view=diff
==============================================================================
--- incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/CombineCondition.java (original)
+++ incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/CombineCondition.java Wed Oct 31 05:26:43 2012
@@ -1,18 +1,11 @@
/*
- * Copyright: (c) 2009 Mayo Foundation for Medical Education and
- * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
- * triple-shield Mayo logo are trademarks and service marks of MFMER.
- *
- * Except as contained in the copyright notice above, or as used to identify
- * MFMER as the author of this software, the trade names, trademarks, service
- * marks, or product names of the copyright holder shall not be used in
- * advertising, promotion or otherwise in connection with this software without
- * prior written authorization of the copyright holder.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@@ -21,30 +14,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.mayo.bmi.fsm.condition;
-
-import net.openai.util.fsm.Condition;
-
-/**
- *
- * @author Mayo Clinic
- */
-@SuppressWarnings("serial")
-public class CombineCondition extends Condition {
- private Condition iv_condition1;
- private Condition iv_condition2;
-
- public CombineCondition(Condition c1, Condition c2) {
- iv_condition1 = c1;
- iv_condition2 = c2;
- }
-
- /**
- * Called to check if the conditional meets the criteria defined by this
- * state.
- */
- public boolean satisfiedBy(Object conditional) {
- return (iv_condition1.satisfiedBy(conditional) && iv_condition2
- .satisfiedBy(conditional));
- }
-}
+package edu.mayo.bmi.fsm.condition;
+
+import net.openai.util.fsm.Condition;
+
+/**
+ *
+ * @author Mayo Clinic
+ */
+@SuppressWarnings("serial")
+public class CombineCondition extends Condition {
+ private Condition iv_condition1;
+ private Condition iv_condition2;
+
+ public CombineCondition(Condition c1, Condition c2) {
+ iv_condition1 = c1;
+ iv_condition2 = c2;
+ }
+
+ /**
+ * Called to check if the conditional meets the criteria defined by this
+ * state.
+ */
+ public boolean satisfiedBy(Object conditional) {
+ return (iv_condition1.satisfiedBy(conditional) && iv_condition2
+ .satisfiedBy(conditional));
+ }
+}
Modified: incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DayNightWordCondition.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DayNightWordCondition.java?rev=1403989&r1=1403988&r2=1403989&view=diff
==============================================================================
--- incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DayNightWordCondition.java (original)
+++ incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DayNightWordCondition.java Wed Oct 31 05:26:43 2012
@@ -1,18 +1,11 @@
/*
- * Copyright: (c) 2009 Mayo Foundation for Medical Education and
- * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
- * triple-shield Mayo logo are trademarks and service marks of MFMER.
- *
- * Except as contained in the copyright notice above, or as used to identify
- * MFMER as the author of this software, the trade names, trademarks, service
- * marks, or product names of the copyright holder shall not be used in
- * advertising, promotion or otherwise in connection with this software without
- * prior written authorization of the copyright holder.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@@ -21,31 +14,31 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.mayo.bmi.fsm.condition;
-
-import net.openai.util.fsm.Condition;
-import edu.mayo.bmi.fsm.token.WordToken;
-
-/**
- * Handles case of A.M. and P.M. The WordToken will actually be "A.M" or "P.M"
- *
- * @author Mayo Clinic
- */
-@SuppressWarnings("serial")
-public class DayNightWordCondition extends Condition {
- public boolean satisfiedBy(Object conditional) {
- if (conditional instanceof WordToken) {
- WordToken wt = (WordToken) conditional;
- String text = wt.getText();
- if (text.length() == 3) {
- text = text.toUpperCase();
- if ((text.charAt(2) == 'M') && (text.charAt(1) == '.')
- && ((text.charAt(0) == 'A') || (text.charAt(0) == 'P'))) {
- return true;
- }
- }
-
- }
- return false;
- }
-}
+package edu.mayo.bmi.fsm.condition;
+
+import net.openai.util.fsm.Condition;
+import edu.mayo.bmi.fsm.token.WordToken;
+
+/**
+ * Handles case of A.M. and P.M. The WordToken will actually be "A.M" or "P.M"
+ *
+ * @author Mayo Clinic
+ */
+@SuppressWarnings("serial")
+public class DayNightWordCondition extends Condition {
+ public boolean satisfiedBy(Object conditional) {
+ if (conditional instanceof WordToken) {
+ WordToken wt = (WordToken) conditional;
+ String text = wt.getText();
+ if (text.length() == 3) {
+ text = text.toUpperCase();
+ if ((text.charAt(2) == 'M') && (text.charAt(1) == '.')
+ && ((text.charAt(0) == 'A') || (text.charAt(0) == 'P'))) {
+ return true;
+ }
+ }
+
+ }
+ return false;
+ }
+}
Modified: incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DecimalCondition.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DecimalCondition.java?rev=1403989&r1=1403988&r2=1403989&view=diff
==============================================================================
--- incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DecimalCondition.java (original)
+++ incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DecimalCondition.java Wed Oct 31 05:26:43 2012
@@ -1,18 +1,11 @@
/*
- * Copyright: (c) 2009 Mayo Foundation for Medical Education and
- * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
- * triple-shield Mayo logo are trademarks and service marks of MFMER.
- *
- * Except as contained in the copyright notice above, or as used to identify
- * MFMER as the author of this software, the trade names, trademarks, service
- * marks, or product names of the copyright holder shall not be used in
- * advertising, promotion or otherwise in connection with this software without
- * prior written authorization of the copyright holder.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@@ -21,26 +14,26 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.mayo.bmi.fsm.condition;
-
-import net.openai.util.fsm.Condition;
-import edu.mayo.bmi.fsm.token.DecimalToken;
-
-/**
- *
- * @author Mayo Clinic
- */
-@SuppressWarnings("serial")
-public class DecimalCondition extends Condition {
- /**
- * Called to check if the conditional meets the criteria defined by this
- * state.
- */
- public boolean satisfiedBy(Object conditional) {
- if (conditional instanceof DecimalToken) {
- return true;
- }
-
- return false;
- }
-}
+package edu.mayo.bmi.fsm.condition;
+
+import net.openai.util.fsm.Condition;
+import edu.mayo.bmi.fsm.token.DecimalToken;
+
+/**
+ *
+ * @author Mayo Clinic
+ */
+@SuppressWarnings("serial")
+public class DecimalCondition extends Condition {
+ /**
+ * Called to check if the conditional meets the criteria defined by this
+ * state.
+ */
+ public boolean satisfiedBy(Object conditional) {
+ if (conditional instanceof DecimalToken) {
+ return true;
+ }
+
+ return false;
+ }
+}
Modified: incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DecimalRangeCondition.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DecimalRangeCondition.java?rev=1403989&r1=1403988&r2=1403989&view=diff
==============================================================================
--- incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DecimalRangeCondition.java (original)
+++ incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DecimalRangeCondition.java Wed Oct 31 05:26:43 2012
@@ -1,18 +1,11 @@
/*
- * Copyright: (c) 2009 Mayo Foundation for Medical Education and
- * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
- * triple-shield Mayo logo are trademarks and service marks of MFMER.
- *
- * Except as contained in the copyright notice above, or as used to identify
- * MFMER as the author of this software, the trade names, trademarks, service
- * marks, or product names of the copyright holder shall not be used in
- * advertising, promotion or otherwise in connection with this software without
- * prior written authorization of the copyright holder.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@@ -21,42 +14,42 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.mayo.bmi.fsm.condition;
-
-import net.openai.util.fsm.Condition;
-import edu.mayo.bmi.fsm.token.DecimalToken;
-
-/**
- *
- * @author Mayo Clinic
- */
-@SuppressWarnings("serial")
-public class DecimalRangeCondition extends Condition {
- private double iv_lowNum;
- private double iv_highNum;
-
- /**
- * Constructor
- *
- * @param t
- */
- public DecimalRangeCondition(double lowNumber, double highNumber) {
- iv_lowNum = lowNumber;
- iv_highNum = highNumber;
- }
-
- /**
- * Called to check if the conditional meets the criteria defined by this
- * state.
- */
- public boolean satisfiedBy(Object conditional) {
- if (conditional instanceof DecimalToken) {
- DecimalToken t = (DecimalToken) conditional;
- if ((t.getValue() >= iv_lowNum) && (t.getValue() <= iv_highNum)) {
- return true;
- }
- }
-
- return false;
- }
-}
+package edu.mayo.bmi.fsm.condition;
+
+import net.openai.util.fsm.Condition;
+import edu.mayo.bmi.fsm.token.DecimalToken;
+
+/**
+ *
+ * @author Mayo Clinic
+ */
+@SuppressWarnings("serial")
+public class DecimalRangeCondition extends Condition {
+ private double iv_lowNum;
+ private double iv_highNum;
+
+ /**
+ * Constructor
+ *
+ * @param t
+ */
+ public DecimalRangeCondition(double lowNumber, double highNumber) {
+ iv_lowNum = lowNumber;
+ iv_highNum = highNumber;
+ }
+
+ /**
+ * Called to check if the conditional meets the criteria defined by this
+ * state.
+ */
+ public boolean satisfiedBy(Object conditional) {
+ if (conditional instanceof DecimalToken) {
+ DecimalToken t = (DecimalToken) conditional;
+ if ((t.getValue() >= iv_lowNum) && (t.getValue() <= iv_highNum)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
Modified: incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DecimalValueCondition.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DecimalValueCondition.java?rev=1403989&r1=1403988&r2=1403989&view=diff
==============================================================================
--- incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DecimalValueCondition.java (original)
+++ incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DecimalValueCondition.java Wed Oct 31 05:26:43 2012
@@ -1,18 +1,11 @@
/*
- * Copyright: (c) 2009 Mayo Foundation for Medical Education and
- * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
- * triple-shield Mayo logo are trademarks and service marks of MFMER.
- *
- * Except as contained in the copyright notice above, or as used to identify
- * MFMER as the author of this software, the trade names, trademarks, service
- * marks, or product names of the copyright holder shall not be used in
- * advertising, promotion or otherwise in connection with this software without
- * prior written authorization of the copyright holder.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@@ -21,40 +14,40 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.mayo.bmi.fsm.condition;
-
-import net.openai.util.fsm.Condition;
-import edu.mayo.bmi.fsm.token.DecimalToken;
-
-/**
- *
- * @author Mayo Clinic
- */
-@SuppressWarnings("serial")
-public class DecimalValueCondition extends Condition {
- private double iv_num;
-
- /**
- * Constructor
- *
- * @param t
- */
- public DecimalValueCondition(double value) {
- iv_num = value;
- }
-
- /**
- * Called to check if the conditional meets the criteria defined by this
- * state.
- */
- public boolean satisfiedBy(Object conditional) {
- if (conditional instanceof DecimalToken) {
- DecimalToken t = (DecimalToken) conditional;
- if (t.getValue() == iv_num) {
- return true;
- }
- }
-
- return false;
- }
-}
+package edu.mayo.bmi.fsm.condition;
+
+import net.openai.util.fsm.Condition;
+import edu.mayo.bmi.fsm.token.DecimalToken;
+
+/**
+ *
+ * @author Mayo Clinic
+ */
+@SuppressWarnings("serial")
+public class DecimalValueCondition extends Condition {
+ private double iv_num;
+
+ /**
+ * Constructor
+ *
+ * @param t
+ */
+ public DecimalValueCondition(double value) {
+ iv_num = value;
+ }
+
+ /**
+ * Called to check if the conditional meets the criteria defined by this
+ * state.
+ */
+ public boolean satisfiedBy(Object conditional) {
+ if (conditional instanceof DecimalToken) {
+ DecimalToken t = (DecimalToken) conditional;
+ if (t.getValue() == iv_num) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
Modified: incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DisjoinCondition.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DisjoinCondition.java?rev=1403989&r1=1403988&r2=1403989&view=diff
==============================================================================
--- incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DisjoinCondition.java (original)
+++ incubator/ctakes/branches/SHARPn-cTAKES/core/src/edu/mayo/bmi/fsm/condition/DisjoinCondition.java Wed Oct 31 05:26:43 2012
@@ -1,18 +1,11 @@
/*
- * Copyright: (c) 2009 Mayo Foundation for Medical Education and
- * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
- * triple-shield Mayo logo are trademarks and service marks of MFMER.
- *
- * Except as contained in the copyright notice above, or as used to identify
- * MFMER as the author of this software, the trade names, trademarks, service
- * marks, or product names of the copyright holder shall not be used in
- * advertising, promotion or otherwise in connection with this software without
- * prior written authorization of the copyright holder.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@@ -21,30 +14,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.mayo.bmi.fsm.condition;
-
-import net.openai.util.fsm.Condition;
-
-/**
- *
- * @author Mayo Clinic
- */
-@SuppressWarnings("serial")
-public class DisjoinCondition extends Condition {
- private Condition iv_condition1;
- private Condition iv_condition2;
-
- public DisjoinCondition(Condition c1, Condition c2) {
- iv_condition1 = c1;
- iv_condition2 = c2;
- }
-
- /**
- * Called to check if the conditional meets the criteria defined by this
- * state.
- */
- public boolean satisfiedBy(Object conditional) {
- return (iv_condition1.satisfiedBy(conditional) || iv_condition2
- .satisfiedBy(conditional));
- }
-}
+package edu.mayo.bmi.fsm.condition;
+
+import net.openai.util.fsm.Condition;
+
+/**
+ *
+ * @author Mayo Clinic
+ */
+@SuppressWarnings("serial")
+public class DisjoinCondition extends Condition {
+ private Condition iv_condition1;
+ private Condition iv_condition2;
+
+ public DisjoinCondition(Condition c1, Condition c2) {
+ iv_condition1 = c1;
+ iv_condition2 = c2;
+ }
+
+ /**
+ * Called to check if the conditional meets the criteria defined by this
+ * state.
+ */
+ public boolean satisfiedBy(Object conditional) {
+ return (iv_condition1.satisfiedBy(conditional) || iv_condition2
+ .satisfiedBy(conditional));
+ }
+}