當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityNamePartType類代碼示例

本文整理匯總了Java中org.marc.everest.datatypes.EntityNamePartType的典型用法代碼示例。如果您正苦於以下問題:Java EntityNamePartType類的具體用法?Java EntityNamePartType怎麽用?Java EntityNamePartType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EntityNamePartType類屬於org.marc.everest.datatypes包,在下文中一共展示了EntityNamePartType類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: nameFullTest

import org.marc.everest.datatypes.EntityNamePartType; //導入依賴的package包/類
@Test
public void nameFullTest() {
	SET<PN> names = recordTargetModel.getNames();
	assertNotNull(names);
	assertEquals(1, names.size());

	PN name = names.get(0);
	assertNotNull(name);
	assertEquals(EntityNameUse.Legal, name.getUse().get(0).getCode());

	List<ENXP> nameParts = name.getParts();
	assertNotNull(nameParts);
	assertEquals(2, nameParts.size());
	assertTrue(nameParts.contains(new ENXP(demographic.getFirstName(), EntityNamePartType.Given)));
	assertTrue(nameParts.contains(new ENXP(demographic.getLastName(), EntityNamePartType.Family)));
}
 
開發者ID:williamgrosset,項目名稱:OSCAR-ConCert,代碼行數:17,代碼來源:RecordTargetModelTest.java

示例2: personFullTest

import org.marc.everest.datatypes.EntityNamePartType; //導入依賴的package包/類
@Test
public void personFullTest() {
	Person person = authorModel.getPerson();
	assertNotNull(person);

	SET<PN> names = person.getName();
	assertNotNull(names);
	assertEquals(1, names.size());

	PN name = names.get(0);
	assertNotNull(name);
	assertEquals(EntityNameUse.OfficialRecord, name.getUse().get(0).getCode());

	List<ENXP> nameParts = name.getParts();
	assertNotNull(nameParts);
	assertEquals(2, nameParts.size());
	assertTrue(nameParts.contains(new ENXP(provider.getFirstName(), EntityNamePartType.Given)));
	assertTrue(nameParts.contains(new ENXP(provider.getLastName(), EntityNamePartType.Family)));
}
 
開發者ID:williamgrosset,項目名稱:OSCAR-ConCert,代碼行數:20,代碼來源:AuthorModelTest.java

示例3: nameLensGetTest

import org.marc.everest.datatypes.EntityNamePartType; //導入依賴的package包/類
@Test
public void nameLensGetTest() {
	NameLens lens = new NameLens();
	assertNotNull(lens);

	Pair<Demographic, RecordTarget> pair = lens.get(getPair);
	assertNotNull(pair);
	assertNotNull(pair.getLeft());
	assertNotNull(pair.getRight());

	SET<PN> names = pair.getRight().getPatientRole().getPatient().getName();
	assertNotNull(names);
	assertEquals(1, names.size());
	assertTrue(names.get(0).getParts().contains(new ENXP(demographic.getFirstName(), EntityNamePartType.Given)));
	assertTrue(names.get(0).getParts().contains(new ENXP(demographic.getLastName(), EntityNamePartType.Family)));
}
 
開發者ID:jujaga,項目名稱:bxe2e,代碼行數:17,代碼來源:RecordTargetLensesTest.java

示例4: nameLensPutTest

import org.marc.everest.datatypes.EntityNamePartType; //導入依賴的package包/類
@Test
public void nameLensPutTest() {
	NameLens lens = new NameLens();
	assertNotNull(lens);

	List<ENXP> name = new ArrayList<>();
	name.add(new NamePartLens(EntityNamePartType.Given).get(demographic.getFirstName()));
	name.add(new NamePartLens(EntityNamePartType.Family).get(demographic.getLastName()));

	SET<PN> names = new SET<>(new PN(EntityNameUse.Legal, name));
	putPair.getRight().getPatientRole().getPatient().setName(names);

	Pair<Demographic, RecordTarget> pair = lens.put(putPair, putPair);
	assertNotNull(pair);
	assertNotNull(pair.getLeft());
	assertNotNull(pair.getRight());
	assertEquals(demographic.getFirstName(), pair.getLeft().getFirstName());
	assertEquals(demographic.getLastName(), pair.getLeft().getLastName());
}
 
開發者ID:jujaga,項目名稱:bxe2e,代碼行數:20,代碼來源:RecordTargetLensesTest.java

示例5: getProviderAsPerson

import org.marc.everest.datatypes.EntityNamePartType; //導入依賴的package包/類
protected Person getProviderAsPerson(Provider provider) {
	if (provider == null) {
		return null;
	}

	return new Person(PN.fromEN(EN.createEN(EntityNameUse.Legal, new ENXP(provider.getFirstName(), EntityNamePartType.Given), new ENXP(provider.getLastName(), EntityNamePartType.Family))), null);
}
 
開發者ID:williamgrosset,項目名稱:OSCAR-ConCert,代碼行數:8,代碼來源:GenericPlaceholder.java

示例6: addNamePart

import org.marc.everest.datatypes.EntityNamePartType; //導入依賴的package包/類
public static void addNamePart(SET<PN> names, String firstName, String lastName, EntityNameUse entityNameUse) {
	ArrayList<ENXP> name = new ArrayList<ENXP>();
	if(!isNullorEmptyorWhitespace(firstName)) {
		name.add(new ENXP(firstName, EntityNamePartType.Given));
	}
	if(!isNullorEmptyorWhitespace(lastName)) {
		name.add(new ENXP(lastName, EntityNamePartType.Family));
	}
	if(!name.isEmpty()) {
		names.add(new PN(entityNameUse, name));
	}
}
 
開發者ID:williamgrosset,項目名稱:OSCAR-ConCert,代碼行數:13,代碼來源:EverestUtils.java

示例7: setProviderInfo

import org.marc.everest.datatypes.EntityNamePartType; //導入依賴的package包/類
private static AuthorTemplate setProviderInfo(AuthorTemplate template, Provider provider) {
	AuthoringPersonTemplate author = (AuthoringPersonTemplate)template;
	author.addId(OidUtil.getOid(OidType.PROVIDER_OID), provider.getProviderNo());
	author.addName(EntityNameUse.Legal, provider.getTitle(), EntityNamePartType.Title);
	author.addName(EntityNameUse.Legal, provider.getFirstName(), EntityNamePartType.Given);
	author.addName(EntityNameUse.Legal, provider.getLastName(), EntityNamePartType.Family);
	author.addAddress(PostalAddressUse.WorkPlace, provider.getAddress(), AddressPartType.AddressLine);
	author.addTelecom(TelecommunicationsAddressUse.Home, provider.getPhone());
	author.addTelecom(TelecommunicationsAddressUse.WorkPlace, provider.getWorkPhone());
	author.addTelecom(TelecommunicationsAddressUse.WorkPlace, provider.getEmail());
    return template;
}
 
開發者ID:williamgrosset,項目名稱:OSCAR-ConCert,代碼行數:13,代碼來源:CDADocumentUtil.java

示例8: setRecordTargetInfo

import org.marc.everest.datatypes.EntityNamePartType; //導入依賴的package包/類
private static RecordTargetTemplate setRecordTargetInfo(Demographic target) {
    RecordTargetTemplate result = phrExtractDocument.addRecordTarget(OidUtil.getOid(OidType.PATIENT_OID), target.getDemographicNo().toString(), target.getFirstName(), target.getLastName(), parseGender(target.getSex()), target.getPhone());
    result.addName(EntityNameUse.Legal, target.getTitle(), EntityNamePartType.Title);
    result.addName(EntityNameUse.Anonymous, target.getAnonymous(), EntityNamePartType.Given);
    result.addAddress(PostalAddressUse.PrimaryHome, target.getAddress(), AddressPartType.AddressLine);
    result.addAddress(PostalAddressUse.PrimaryHome, target.getCity(), AddressPartType.City);
    result.addAddress(PostalAddressUse.PrimaryHome, target.getProvince(), AddressPartType.State);
    result.addAddress(PostalAddressUse.PrimaryHome, target.getPostal(), AddressPartType.PostalCode);
    result.addAddress(PostalAddressUse.PrimaryHome, "CA", AddressPartType.Country);
    result.setBirthTime(new Time(target.getBirthDay()));
    result.addTelecom(TelecommunicationsAddressUse.WorkPlace, target.getPhone2());
    result.addTelecom(TelecommunicationsAddressUse.Direct, target.getEmail());
    return result;
}
 
開發者ID:williamgrosset,項目名稱:OSCAR-ConCert,代碼行數:15,代碼來源:CDADocumentUtil.java

示例9: AuthorPersonLens

import org.marc.everest.datatypes.EntityNamePartType; //導入依賴的package包/類
public AuthorPersonLens() {
	get = providerNo -> {
		Provider provider = EverestUtils.getProviderFromString(providerNo);

		Person person = new Person();
		if(provider != null) {
			SET<PN> names = new SET<>();
			List<ENXP> name = new ArrayList<>();
			if(!EverestUtils.isNullorEmptyorWhitespace(provider.getFirstName())) {
				name.add(new NamePartLens(EntityNamePartType.Given).get(provider.getFirstName()));
			}
			if(!EverestUtils.isNullorEmptyorWhitespace(provider.getLastName())) {
				name.add(new NamePartLens(EntityNamePartType.Family).get(provider.getLastName()));
			}

			if(!name.isEmpty()) {
				names = new SET<>(new PN(EntityNameUse.OfficialRecord, name));
			} else {
				PN pn = new PN();
				pn.setNullFlavor(NullFlavor.NoInformation);
				names.add(pn);
			}
			person.setName(names);
		} else {
			person.setNullFlavor(NullFlavor.NoInformation);
		}

		return person;
	};

	put = (providerNo, person) -> {
		return providerNo;
	};
}
 
開發者ID:jujaga,項目名稱:bxe2e,代碼行數:35,代碼來源:AuthorPersonLens.java

示例10: providerPersonLensGetTest

import org.marc.everest.datatypes.EntityNamePartType; //導入依賴的package包/類
@Test
public void providerPersonLensGetTest() {
	ProviderPersonLens lens = new ProviderPersonLens();
	assertNotNull(lens);

	Pair<String, ArrayList<Author>> pair = lens.get(getPair);
	assertNotNull(pair);
	assertNotNull(pair.getLeft());
	assertNotNull(pair.getRight());

	Person person = pair.getRight().get(0).getAssignedAuthor().getAssignedAuthorChoiceIfAssignedPerson();
	assertNotNull(person);
	assertTrue(person.getName().get(0).getParts().contains(new ENXP(provider.getFirstName(), EntityNamePartType.Given)));
	assertTrue(person.getName().get(0).getParts().contains(new ENXP(provider.getLastName(), EntityNamePartType.Family)));
}
 
開發者ID:jujaga,項目名稱:bxe2e,代碼行數:16,代碼來源:AuthorLensesTest.java

示例11: authorPersonLensGetTest

import org.marc.everest.datatypes.EntityNamePartType; //導入依賴的package包/類
@Test
public void authorPersonLensGetTest() {
	final String test = Constants.Runtime.VALID_PROVIDER.toString();
	final Provider provider = EverestUtils.getProviderFromString(test);
	final String originalFirstName = provider.getFirstName();
	final String originalLastName = provider.getLastName();

	AuthorPersonLens lens = new AuthorPersonLens();
	assertNotNull(lens);

	// Null
	assertNotNull(lens.get(null));
	assertEquals(NullFlavor.NoInformation, lens.get(null).getNullFlavor().getCode());

	// Invalid
	assertNotNull(lens.get(Constants.Runtime.INVALID_VALUE.toString()));
	assertEquals(NullFlavor.NoInformation, lens.get(null).getNullFlavor().getCode());

	// Normal
	assertNotNull(lens.get(test));
	assertTrue(lens.get(test).getName().get(0).getParts().stream().anyMatch(e -> e.getType().getCode() == EntityNamePartType.Given));
	assertTrue(lens.get(test).getName().get(0).getParts().stream().anyMatch(e -> e.getType().getCode() == EntityNamePartType.Family));

	// Null Names
	provider.setFirstName(null);
	provider.setLastName(null);
	assertNotNull(lens.get(test));
	assertEquals(NullFlavor.NoInformation, lens.get(test).getName().get(0).getNullFlavor().getCode());

	// Reset provider
	provider.setFirstName(originalFirstName);
	provider.setLastName(originalLastName);
}
 
開發者ID:jujaga,項目名稱:bxe2e,代碼行數:34,代碼來源:CommonLensesTest.java

示例12: namePartLensGetTest

import org.marc.everest.datatypes.EntityNamePartType; //導入依賴的package包/類
@Test
public void namePartLensGetTest() {
	final String test = "test";

	assertNotNull(new NamePartLens(null));
	NamePartLens lens = new NamePartLens(EntityNamePartType.Given);
	assertNotNull(lens);

	assertNotNull(lens.get(test));
	assertEquals(EntityNamePartType.Given, lens.get(test).getType().getCode());
	assertEquals(test, lens.get(test).getValue());
}
 
開發者ID:jujaga,項目名稱:bxe2e,代碼行數:13,代碼來源:CommonLensesTest.java

示例13: namePartLensPutTest

import org.marc.everest.datatypes.EntityNamePartType; //導入依賴的package包/類
@Test
public void namePartLensPutTest() {
	final String test = "test";

	assertNotNull(new NamePartLens(null));
	NamePartLens lens = new NamePartLens(EntityNamePartType.Given);
	assertNotNull(lens);

	assertNull(lens.put(new ENXP(test, null)));
	assertEquals(test, lens.put(test, new ENXP(null, null)));

	assertNotNull(lens.put(lens.get(test)));
}
 
開發者ID:jujaga,項目名稱:bxe2e,代碼行數:14,代碼來源:CommonLensesTest.java

示例14: toQuery

import org.marc.everest.datatypes.EntityNamePartType; //導入依賴的package包/類
/**
 * Creates new query instance
 * 
 * @param demographic
 *            Demographic to create query for
 * @return Returns the new query
 */
private PRPA_IN101103CA toQuery(Provider provider, Demographic demographic) {
	PRPA_IN101103CA findCandidates = new PRPA_IN101103CA(new II(UUID.randomUUID()), // II.TOKEN in pCS
	        TS.now(), ResponseMode.Immediate, PRPA_IN101103CA.defaultInteractionId(), PRPA_IN101103CA.defaultProfileId(), ProcessingID.Training, AcknowledgementCondition.Always);
	
	// Setup sender
	findCandidates.setSender(new Sender(
			new TEL(getSender().getUrl()),
			new Device1(new II("1.3.6.1.4.1.33349.3.1.1.22", getSender().getName()), 
				new ST(getSender().getName()),
				new ST(getSender().getName()), 
				null, 
				null, 
				null
			)));
	
	findCandidates.setReceiver(new Receiver(new TEL(getReceiver().getUrl()), 
		new Device2(
				new II("1.3.6.1.4.1.33349.3.1.1.2", "CR")
		)
	));
	
	// Setup request
	findCandidates.setControlActEvent(new ControlActEvent<ParameterList>());
	findCandidates.getControlActEvent().setCode(PRPA_IN101103CA.defaultTriggerEvent());
	findCandidates.getControlActEvent().setEffectiveTime(TS.now());

	// Add author data
	if (provider != null) {
		findCandidates.getControlActEvent().setAuthor(new Author(TS.now()));
		findCandidates.getControlActEvent().getAuthor().setAuthorPerson(new AssignedEntity(SET.createSET(new II("1.2.3.4", "FS-39485")), getProviderAsPerson(provider)));
	}

	// Query control data
	findCandidates.getControlActEvent().setQueryByParameter(new QueryByParameter<ParameterList>());
	findCandidates.getControlActEvent().getQueryByParameter().setQueryId(UUID.randomUUID());
	findCandidates.getControlActEvent().getQueryByParameter().setInitialQuantity(10);
	findCandidates.getControlActEvent().getQueryByParameter().setInitialQuantityCode(QueryRequestLimit.Record);

	// Parameter list
	findCandidates.getControlActEvent().getQueryByParameter().setParameterList(new ParameterList());
	findCandidates.getControlActEvent().getQueryByParameter().getParameterList().setAdministrativeGender(new org.marc.everest.rmim.ca.r020403.prpa_mt101103ca.AdministrativeGender(Utils.toAdminGender(demographic.getSex())));
	findCandidates.getControlActEvent().getQueryByParameter().getParameterList().getPersonName().add(new PersonName(PN.fromEN(EN.createEN(EntityNameUse.Search, new ENXP(demographic.getFirstName(), EntityNamePartType.Given), new ENXP(demographic.getLastName(), EntityNamePartType.Family)))));
	return findCandidates;
}
 
開發者ID:williamgrosset,項目名稱:OSCAR-ConCert,代碼行數:52,代碼來源:PlaceholderPersonRegistryQueryPlacer.java


注:本文中的org.marc.everest.datatypes.EntityNamePartType類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。