-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major revision update to model to reflect correct system uris. Update…
…d BuildDCD test.
- Loading branch information
1 parent
8e91cac
commit 7717241
Showing
72 changed files
with
6,523 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/main/java/edu/gatech/VRDR/model/TobaccoUseContributedToDeath.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package edu.gatech.VRDR.util; | ||
|
||
import java.util.Arrays; | ||
import java.util.StringJoiner; | ||
|
||
import org.hl7.fhir.dstu3.model.HumanName; | ||
|
||
public class HumanNameParser { | ||
private static final String[] prefixList = {"Mr.", "Mrs.", "Ms.", "Dr.", "Adm", "Capt", "Chief", "Gen", "Gov", "Hon", "Maj", "Prof", "Rabbi", "Rev", "Sister"}; | ||
private static final String[] suffixList = {"II", "III", "IV", "CPA", "DDS", "Esq", "Jr", "LLD", "MD", "PhD", "Ret", "Sr", "DO"}; | ||
public static HumanName createHumanName(String nameString) { | ||
HumanName returnName = new HumanName(); | ||
String[] nameParts = nameString.split("\\s+"); | ||
if(nameParts.length == 1) { | ||
returnName.addGiven(nameParts[0]); | ||
return returnName; | ||
} | ||
if(nameParts.length == 2) { | ||
returnName.addGiven(nameParts[0]); | ||
returnName.setFamily(nameParts[1]); | ||
return returnName; | ||
} | ||
|
||
boolean hasPrefix = false; | ||
boolean hasSuffix = false; | ||
int familyIndex = nameParts.length-1; | ||
int givenStartIndex = 0; | ||
if(Arrays.asList(prefixList).contains(nameParts[0])) { | ||
returnName.addPrefix(nameParts[0]); | ||
givenStartIndex = 1; | ||
} | ||
if(Arrays.asList(suffixList).contains(nameParts[nameParts.length-1])) { | ||
returnName.addSuffix(nameParts[nameParts.length-1]); | ||
familyIndex = nameParts.length-2; | ||
} | ||
String familyName = ""; | ||
String givenName = ""; | ||
if(hasSuffix) { | ||
familyIndex = nameParts.length - 2; | ||
} | ||
StringJoiner joiner = new StringJoiner(" "); | ||
for(int i = givenStartIndex; i < familyIndex; i++) { | ||
joiner.add(nameParts[i]); | ||
} | ||
givenName = joiner.toString(); | ||
familyName = nameParts[familyIndex]; | ||
returnName.addGiven(givenName); | ||
returnName.setFamily(familyName); | ||
return returnName; | ||
} | ||
} |
Oops, something went wrong.