From: Bryan T. <bp...@gm...> - 2005-08-24 15:59:18
|
Hi David,=20 I'm not sure this can be done with conformance profiles, unless you are expecting a constant number of columns (e.g. always 4). If you used HAPI 0.5, you could easily do this with a MessageRule. You would implement ca.uhn.hl7v2.validation.MessageRule to check this constraint and produce a ValidationException if it isn't met. You would then have to tell your parser to apply this rule, using Parser.setValidationContext(). The argument to this method is a ca.uhn.hl7v2.validation.ValidationContext. See ca.uhn.hl7v2.validation.impl.DefaultValidationContext for an example. Bryan=20 On 8/23/05, Empey, David (EDS) <Dav...@me...> wrote: > I want to do a validation of a message like the following: > =20 > MSH^~|\&^DTS Term Srv~~L^200V^XUMF > MFS^T10^20050809154913.903-0600^^MFN~M01~MFN_M01^11236205539030^P^2.4^^^A= L^AL^USA > MFI^med.term.maintenance.GMRVVitalType~GMRV Vital > Type~ERT^^UPD^20050809154913.903-0600^20050809154913.903-0600^NE > MFE^MUP^^20050809154913.903-0600^4688718~AUDIOMETRY~ERT~AUDIOMETRY~AUDIOM= ETRY~VA^CE > RDF^2^vuid~NM~20|name~ST~50=20 > RDT^4688718^AUDIOMETRY=20 > MFE^MUP^^20050809154913.903-0600^4500634~BLOOD > PRESSURE~ERT~BLOOD PRESSURE~BLOOD PRESSURE~VA^CE=20 > RDF^2^vuid~NM~20|name~ST~50 > RDT^4500634^BLOOD PRESSURE=20 > MFE^MUP^^20050809154913.903-0600^4688719~CENTRAL VENOUS > PRESSURE~ERT~CENTRAL VENOUS PRESSURE~CENTRAL VENOUS PRESSURE~VA^CE=20 > RDF^2^vuid~NM~20|name~ST~50 > RDT^4688719^CENTRAL VENOUS PRESSURE > =20 > Specifically, I want to use the HAPI 0.4.2 library to validate the RDF an= d > RDT segments to assure the number of columns in RDF matches the number of > columns in RDT. I've looked at using DefaultValidator and I've looked at > using ProfileTestApplication but I can't get either to work. Maybe I'm > going about validation wrong. Can you help me? > =20 > Thanks > =20 > =20 > =20 >=20 >=20 > David Empey >=20 > Salt Lake OIFO >=20 > 550 Foothill Drive >=20 > Suite 400 >=20 > Salt Lake City, UT 84113 >=20 > =20 >=20 > ( phone: 801-588-5226 >=20 > + mailto:dav...@me... >=20 > www.eds.com >=20 > =20 > |