RECORD MAP parameters

5 views
Skip to first unread message

r.be...@solilog.fr

unread,
Nov 22, 2013, 10:28:22 AM11/22/13
to Ensemble-in...@googlegroups.com
Good evening,

In order to implement the HPRIM norm for healthcare messages , I have created a recordmap called "H" for mapping the H segment in the HPRIM messages.
This is the code of the generated class :


/// RECORDMAP: Generated from RecordMap 'AHP.PRESCRIPTION.AHPUNDERSCOREPRESCRIPTION.HPRIM.H'
/// on 2013-11-22 at 15:56:53.243 [2013-11-22 14:56:53.243 UTC]
/// by user Raouf
Class AHP.PRESCRIPTION.AHPUNDERSCOREPRESCRIPTION.HPRIM.H.Record Extends (%Persistent, %XML.Adaptor, Ens.Request, EnsLib.RecordMap.Base) [ Inheritance = right, ProcedureBlock ]
{

Parameter RECORDMAPGENERATED = 1;

Parameter INCLUDETOPFIELDS = 1;

Property TypeDeSegment As %String(MAXLEN = 1, VALUELIST = "H") [ Required ];

Property DefinitionDesSeparateurs As %String(MAXLEN = 5, MINLEN = 5) [ Required ];

Property NomDuFichier As %String(MAXLEN = 12);

Property MotDePasse As %String(MAXLEN = 12);

Property IdentificationEmetteur As AHP.PRESCRIPTION.AHPUNDERSCOREPRESCRIPTION.HPRIM.H.Record.IdentificationEmetteur;

Property Ligne1Adresse As %String(MAXLEN = 20);

Property Ligne2Adresse As %String(MAXLEN = 20);

Property Ville As %String(MAXLEN = 20);

Property LibelléDepartement As %String(MAXLEN = 20);

Property CodePostal As %String(MAXLEN = 10);

Property Pays As %String(MAXLEN = 10);

Property Contexte As %String(VALUELIST = ",ORM,ORU,ADM,FAC,REG,ERR") [ Required ];

Property NumTelEmeetteur As %String(MAXLEN = 100);

Property CaracteristiquesTransmission As %String(MAXLEN = 40);

Property IdentificationRecepteur As AHP.PRESCRIPTION.AHPUNDERSCOREPRESCRIPTION.HPRIM.H.Record.IdentificationRecepteur;

Property Commentaire As %String(MAXLEN = 80);

Property ModeTraitement As %String(MAXLEN = 1, VALUELIST = ",P,T,D") [ Required ];

Property VersionType As AHP.PRESCRIPTION.AHPUNDERSCOREPRESCRIPTION.HPRIM.H.Record.VersionType;

<Storage name="Default">
<Data name="RecordDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>TypeDeSegment</Value>
</Value>
<Value name="3">
<Value>%Source</Value>
</Value>
<Value name="4">
<Value>NomDuFichier</Value>
</Value>
<Value name="5">
<Value>MotDePasse</Value>
</Value>
<Value name="6">
<Value>IdentificationEmetteur</Value>
</Value>
<Value name="7">
<Value>Ligne1Adresse</Value>
</Value>
<Value name="8">
<Value>Ligne2Adresse</Value>
</Value>
<Value name="9">
<Value>Ville</Value>
</Value>
<Value name="10">
<Value>LibelléDepartement</Value>
</Value>
<Value name="11">
<Value>CodePostal</Value>
</Value>
<Value name="12">
<Value>Pays</Value>
</Value>
<Value name="13">
<Value>Contexte</Value>
</Value>
<Value name="14">
<Value>NumTelEmeetteur</Value>
</Value>
<Value name="15">
<Value>CaracteristiquesTransmission</Value>
</Value>
<Value name="16">
<Value>IdentificationRecepteur</Value>
</Value>
<Value name="17">
<Value>Commentaire</Value>
</Value>
<Value name="18">
<Value>ModeTraitement</Value>
</Value>
<Value name="19">
<Value>VersionType</Value>
</Value>
<Value name="20">
<Value>DefinitionDesSeparateurs</Value>
</Value>
</Data>
<DataLocation>^AHP.PRESCRIPTION.AH15E0.RecordD</DataLocation>
<DefaultData>RecordDefaultData</DefaultData>
<ExtentSize>2000000</ExtentSize>
<IdLocation>^AHP.PRESCRIPTION.AH15E0.RecordD</IdLocation>
<IndexLocation>^AHP.PRESCRIPTION.AH15E0.RecordI</IndexLocation>
<StreamLocation>^AHP.PRESCRIPTION.AH15E0.RecordS</StreamLocation>
<Type>%Library.CacheStorage</Type>
</Storage>
}

As you can see , there is restrictions on many field with the use of the parameters MAXLEN , MINLEN and VALUELIST for string type.
However when i use an example file to test how the recordmap is working , any of these restriction is respected ,  also the record is mapping fields of other segments 

* As you can see the field TypeDeSegment is mapped with "H,P and OBR" values eventhough it's restricted only to "H" value

Can you help me please ?
best regards

Raouf

David Loveluck

unread,
Nov 22, 2013, 11:01:03 AM11/22/13
to Ensemble-in...@googlegroups.com

Parameters such as MAXLEN are enforced when the object is saved. I haven’t looked at the code, but I am guessing the sample file display doesn’t save anything

 

dave

--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en
---
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Ensemble-in-Healt...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Joshua Goldman

unread,
Nov 22, 2013, 11:47:16 AM11/22/13
to Ensemble-in...@googlegroups.com

The Record describes the structure of  the Caché object, but the RecordMap describes the external file. What is the  definition of the RecordMap?

 

Here is one from the ComplexMap sample in 2014.1.

 

Class Demo.ComplexMap.SemesterFixed.Semester Extends EnsLib.RecordMap.RecordMap
{

XData RecordMap [ XMLNamespace = "http://www.intersystems.com/Ensemble/RecordMap]
{<Record xmlns="http://www.intersystems.com/Ensemble/RecordMapname="Demo.ComplexMap.SemesterFixed.Semester" type="fixedwidth" char_encoding="UTF-8" targetClassname="Demo.ComplexMap.SemesterFixed.Semester.Record" complexBatchManaged="1" label="SEM|" paddingChars="\x20" padFromLeft="0" recordTerminator="\x0d\x0a" allowEarlyTerminator="0">
  <Field name="SemesterID" required="0" datatype="%Integer" width="4" index="1"></Field>
  <Field name="Year" required="0" datatype="%Integer" width="4"></Field>
  <Field name="Name" required="0" datatype="%String" width="10"></Field>
  <Field name="NumWeeks" required="0" datatype="%Integer" width="2"></Field>
  <Field name="RecordCount" required="0" datatype="%Integer" width="5"></Field>
</Record>
}

 

These Fields describe the external data. What does the XData RecordMap look like in your code?

 

Thanks

Raouf BESBES

unread,
Nov 22, 2013, 12:31:13 PM11/22/13
to Ensemble-in...@googlegroups.com
Yes but I've already saved my recordmap and generated the objectClasses , so i thought that the parameters should have been enforced when i tried the sample file.But it wasn't the case.

Raouf


2013/11/22 David Loveluck <David.L...@intersystems.com>
You received this message because you are subscribed to a topic in the Google Groups "InterSystems: Ensemble in Healthcare" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/Ensemble-in-Healthcare/t0ts_ohE2GQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to Ensemble-in-Healt...@googlegroups.com.

Raouf BESBES

unread,
Nov 22, 2013, 12:59:30 PM11/22/13
to Ensemble-in...@googlegroups.com
Good evening Joshua,

Actually I'm yet a beginner , i just used the administration console to create a recordmap. And i only found the code that i've already sent you(which i generated from the console administration for recordmaps). so Should i write manually the definition of the recordmap from Studio ? And i still don't understand the difference between the two classes.

Thank you for help


2013/11/22 Joshua Goldman <Joshua....@intersystems.com>
You received this message because you are subscribed to a topic in the Google Groups "InterSystems: Ensemble in Healthcare" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/Ensemble-in-Healthcare/t0ts_ohE2GQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to Ensemble-in-Healt...@googlegroups.com.

Dale du Preez

unread,
Nov 22, 2013, 2:18:59 PM11/22/13
to Ensemble-in...@googlegroups.com
Hi Raouf,

There are two parts to a RecordMap. One part is the actual RecordMap, which plays two roles: it defines the structure of the external file, and it defines the properties and structure of the object that we create in Ensemble. The second part is the object that we generate in Ensemble, which we refer to as a Record.

In brief, the RecordMap implements the parser and the field mapping, and the Record implements the actual persistent object structure that we store and use as an Ensemble message.

As part of this separation, we chose to use the existing Ensemble and Cache object validation options rather than building a whole new approach to property validation in the RecordMapper. This means that the RecordMap parser does not enforce any restrictions on the incoming fields until we try to validate the Record object that gets created from your file. In practice, the save occurs immediately after the parse, so there is very little difference in behaviour.

Finally, the sample parser display in the RecordMapper UI is meant mostly as a quick way to validate that your definition matches the input file. It does not do any field level validation because it is meant to show you how your RecordMap matches against the input file, including missing fields and extra data in the file. It also assumes that you only have one kind of record in the file, so tries to be very permissive in matching the input to your RecordMap. In this case, it sounds like it is being too permissive, and I think we should probably correct that by noting that the record is not valid but still showing how we would parse the data if needed.

I hope that helps clarify how the code hangs together,
Dale

David Loveluck

unread,
Nov 22, 2013, 2:50:37 PM11/22/13
to Ensemble-in...@googlegroups.com

Raouf BESBES

unread,
Nov 25, 2013, 5:22:15 AM11/25/13
to Ensemble-in...@googlegroups.com
Hi Dale,

I've also made test on existing recordmap in a DEMO production , and it confirms what you say about the sample parser.
Thank you a lot for your help.

Raouf


2013/11/22 Dale du Preez <dale.d...@intersystems.com>

Raouf BESBES

unread,
Nov 25, 2013, 5:24:29 AM11/25/13
to Ensemble-in...@googlegroups.com
Thanks for the links Dave.It's actually very useful.

Raouf



2013/11/22 David Loveluck <David.L...@intersystems.com>

If you are just starting with the record maps, the videos below might help.

Reply all
Reply to author
Forward
0 new messages