Topic
  • 7 replies
  • Latest Post - ‏2013-09-26T21:32:06Z by Jim Divoky
JoeMorganNTST
JoeMorganNTST
5 Posts

Pinned topic Newbie: How to insert filler fields into existing type tree?

‏2013-09-26T17:28:46Z |

First said, I only know how to spell WXT (see, I can't even do that!)  I am working with an existing HL7 type tree.  Within a single segment (NM Segment of OBX of HL7 to be exact, but I don't think that matters so much), I need to add 3 *fields* that will be blank (rule will be "=NONE").

I can get the field list opened up, and can even insert something new (which defaults to "NewComponent0"), but for the life of me, I cannot figure out how to change it to an ST type.  I tried dragging in the "AnyText" type from the available ST elements, but that doesn't seem to work.  It does add a blank element, but doesn't give me the ability to do anything with it.

So, without getting bogged down in HL7, and just focusing on how to work with WTX, I really need to insert 3 elements that will be hard-coded blank in the output.  So, if I have something like this:

Input segment object with 4 fields:

Field1 ST Element Field (0:1)
Field2 ST Element Field (0:1)
Field3 ST Element Field (0:1)
Field4 ST Element Field (0:1)

A|B|C|D    I want to add 3 blanks to the output so I have    A|B|C||||D

So I have:

Field1 ST Element Field (0:1)
Field2 ST Element Field (0:1)
Field3 ST Element Field (0:1)
Filler1 ST Element Field (1:1)
Filler2 ST Element Field (1:1)
Filler3 ST Element Field (1:1)
Field4 ST Element Field (0:1)

How????

 

Updated on 2013-09-26T17:29:46Z at 2013-09-26T17:29:46Z by JoeMorganNTST
  • Jim Divoky
    Jim Divoky
    20 Posts
    ACCEPTED ANSWER

    Re: Newbie: How to insert filler fields into existing type tree?

    ‏2013-09-26T18:35:28Z  

    First right click in the appropriate area of your type tree and select Add. Or you can Copy an existing field. Right click on the new field and select Properties.  It sounds like you can define the min & max size and pad the field with spaces to do what you want.

    Drag the newly created field into the record where you need it. Right click on the new field in the record and "Set Range" to Min=3 & Max=3. That will force three occurrences of the field in your output padded with spaces to the size you specified in Properties..

     

    Updated on 2013-09-26T18:37:16Z at 2013-09-26T18:37:16Z by Jim Divoky
  • Jim Divoky
    Jim Divoky
    20 Posts
    ACCEPTED ANSWER

    Re: Newbie: How to insert filler fields into existing type tree?

    ‏2013-09-26T20:55:26Z  

    Which, of course, I did.  This is essentially what I get from that query:

    Hint: Look at the super-type's component list. The component is a valid type, but the supertype has a component list that restricts you from using this type as a component. You may have added subtype components before adding supertype components. Either remove all supertype components or add the components in error to the component list of the supertype.

    So, going back to my lack of any form of knowledge about how WTX views the world, I feel I've already taken care of that.  I put the filler fields on the OBX type, which appears, to me, to be the supertype of the NM element.  The OBX Type now has the 3 filler fields.  Just like that, the map is still good.  When I attempt to add them to the NM type, the sub-type of OBX, that's when it goes bad.

    As best as I can tell, I've already done what the google search provides for me.  No luck.

    You originally said that you "drag[ged] the 3 OBX Filler Fields into NM."  Now you say you "add[ed] them to the NM type."  That is two different actions. The dragging them from the OBX type will result in the error you saw.  Adding them to the NM type (as the Hint recommends) should not result in an error.  Did you copy or drag the fields in the OBX to the NM?

  • Jim Divoky
    Jim Divoky
    20 Posts

    Re: Newbie: How to insert filler fields into existing type tree?

    ‏2013-09-26T18:35:28Z  

    First right click in the appropriate area of your type tree and select Add. Or you can Copy an existing field. Right click on the new field and select Properties.  It sounds like you can define the min & max size and pad the field with spaces to do what you want.

    Drag the newly created field into the record where you need it. Right click on the new field in the record and "Set Range" to Min=3 & Max=3. That will force three occurrences of the field in your output padded with spaces to the size you specified in Properties..

     

    Updated on 2013-09-26T18:37:16Z at 2013-09-26T18:37:16Z by Jim Divoky
  • JoeMorganNTST
    JoeMorganNTST
    5 Posts

    Re: Newbie: How to insert filler fields into existing type tree?

    ‏2013-09-26T19:34:47Z  

    First right click in the appropriate area of your type tree and select Add. Or you can Copy an existing field. Right click on the new field and select Properties.  It sounds like you can define the min & max size and pad the field with spaces to do what you want.

    Drag the newly created field into the record where you need it. Right click on the new field in the record and "Set Range" to Min=3 & Max=3. That will force three occurrences of the field in your output padded with spaces to the size you specified in Properties..

     

    OK.  So in my type tree, I have a very very large number of pre-defined fields, components, segments, etc.  Under Field->Element->ST, which is defined as a text field, it already has a "FillerField1" and "FillerField2".  I copied "FillerField2" and made a "FillerField3".  So, now I have 3 simple text element types.

    Now, I go under Segment->OBX. OBX has under it a number of types, one of them is "NM", the type I want to add the 3 filler fields to.  Interestingly enough, if I click on OBX, I see the exact same layout as if I click on the "NM" under it.  I interpret this to mean the "NM" is inherited or derived from OBX.  I cannot drag-drop onto NM.  So, I drag the 3 filler fields into OBX, which it lets me do.  I save the type tree, analyze it, and all is well at this point.

    NM does not have the fields, which I thought it would.  I also don't see them in the existing map.  So, I open NM under OBX, and it lets me drag the 3 OBX Filler Fields into NM.  Now the type tree no longer analyzes successfully.  For each field, I get the following:

    L100 - COMPONENT neither inherited nor local: 'FillerField1 ST Element Field' of TYPE:
       'NM OBX Segment HL7' (error)

    L100 - COMPONENT neither inherited nor local: 'FillerField2 ST Element Field' of TYPE:
       'NM OBX Segment HL7' (error)

    L100 - COMPONENT neither inherited nor local: 'FillerField3 ST Element Field' of TYPE:
       'NM OBX Segment HL7' (error)

     

    Updated on 2013-09-26T19:36:44Z at 2013-09-26T19:36:44Z by JoeMorganNTST
  • Jim Divoky
    Jim Divoky
    20 Posts

    Re: Newbie: How to insert filler fields into existing type tree?

    ‏2013-09-26T19:57:46Z  

    OK.  So in my type tree, I have a very very large number of pre-defined fields, components, segments, etc.  Under Field->Element->ST, which is defined as a text field, it already has a "FillerField1" and "FillerField2".  I copied "FillerField2" and made a "FillerField3".  So, now I have 3 simple text element types.

    Now, I go under Segment->OBX. OBX has under it a number of types, one of them is "NM", the type I want to add the 3 filler fields to.  Interestingly enough, if I click on OBX, I see the exact same layout as if I click on the "NM" under it.  I interpret this to mean the "NM" is inherited or derived from OBX.  I cannot drag-drop onto NM.  So, I drag the 3 filler fields into OBX, which it lets me do.  I save the type tree, analyze it, and all is well at this point.

    NM does not have the fields, which I thought it would.  I also don't see them in the existing map.  So, I open NM under OBX, and it lets me drag the 3 OBX Filler Fields into NM.  Now the type tree no longer analyzes successfully.  For each field, I get the following:

    L100 - COMPONENT neither inherited nor local: 'FillerField1 ST Element Field' of TYPE:
       'NM OBX Segment HL7' (error)

    L100 - COMPONENT neither inherited nor local: 'FillerField2 ST Element Field' of TYPE:
       'NM OBX Segment HL7' (error)

    L100 - COMPONENT neither inherited nor local: 'FillerField3 ST Element Field' of TYPE:
       'NM OBX Segment HL7' (error)

     

    Do what I do when I come across an error message I don't understand.  Perform a Google search on "COMPONENT neither inherited nor local".  Often searching for the error message will give an explanation and maybe even an approach to a solution.

  • JoeMorganNTST
    JoeMorganNTST
    5 Posts

    Re: Newbie: How to insert filler fields into existing type tree?

    ‏2013-09-26T20:32:14Z  

    Do what I do when I come across an error message I don't understand.  Perform a Google search on "COMPONENT neither inherited nor local".  Often searching for the error message will give an explanation and maybe even an approach to a solution.

    Which, of course, I did.  This is essentially what I get from that query:

    Hint: Look at the super-type's component list. The component is a valid type, but the supertype has a component list that restricts you from using this type as a component. You may have added subtype components before adding supertype components. Either remove all supertype components or add the components in error to the component list of the supertype.

    So, going back to my lack of any form of knowledge about how WTX views the world, I feel I've already taken care of that.  I put the filler fields on the OBX type, which appears, to me, to be the supertype of the NM element.  The OBX Type now has the 3 filler fields.  Just like that, the map is still good.  When I attempt to add them to the NM type, the sub-type of OBX, that's when it goes bad.

    As best as I can tell, I've already done what the google search provides for me.  No luck.

  • Jim Divoky
    Jim Divoky
    20 Posts

    Re: Newbie: How to insert filler fields into existing type tree?

    ‏2013-09-26T20:55:26Z  

    Which, of course, I did.  This is essentially what I get from that query:

    Hint: Look at the super-type's component list. The component is a valid type, but the supertype has a component list that restricts you from using this type as a component. You may have added subtype components before adding supertype components. Either remove all supertype components or add the components in error to the component list of the supertype.

    So, going back to my lack of any form of knowledge about how WTX views the world, I feel I've already taken care of that.  I put the filler fields on the OBX type, which appears, to me, to be the supertype of the NM element.  The OBX Type now has the 3 filler fields.  Just like that, the map is still good.  When I attempt to add them to the NM type, the sub-type of OBX, that's when it goes bad.

    As best as I can tell, I've already done what the google search provides for me.  No luck.

    You originally said that you "drag[ged] the 3 OBX Filler Fields into NM."  Now you say you "add[ed] them to the NM type."  That is two different actions. The dragging them from the OBX type will result in the error you saw.  Adding them to the NM type (as the Hint recommends) should not result in an error.  Did you copy or drag the fields in the OBX to the NM?

  • JoeMorganNTST
    JoeMorganNTST
    5 Posts

    Re: Newbie: How to insert filler fields into existing type tree?

    ‏2013-09-26T21:12:38Z  

    You originally said that you "drag[ged] the 3 OBX Filler Fields into NM."  Now you say you "add[ed] them to the NM type."  That is two different actions. The dragging them from the OBX type will result in the error you saw.  Adding them to the NM type (as the Hint recommends) should not result in an error.  Did you copy or drag the fields in the OBX to the NM?

    Let's not get too caught up in semantics.  I also said that I couldn't add them directly to NM until after I added them to OBX.  That should probably read "...add them directly to NM until after I dragged them to OBX."

    Initially, I "dragged" them from the ST types into OBX.  This works and appears to be fine.  After saving the tree analyzes successfully.

    So, now the OBX has the 3 additional Filler text fields.  The NM type doesn't visually inherit them (so maybe I'm misunderstanding what WTX type tree is showing me). 

    I still cannot "drag" the Filler types from the ST tree into NM, but it does allow me to "drag" the Filler types from the OBX tree to NM.  However, I did just notice that this "drag" invokes a "move".  That is, when I drag the Filler elements from OBX to NM, I just realized that they no longer appeared in the OBX record.  This explains the L100 error.  It also tells me I must be OK to have the filler types in the OBX type, but does not answer how to *extend* those into the NM type.

    So, taking the hint, I *added* them to the NM type.  The tree is still OK.  I also now see the fields in my map. 

    There must be an easier way.  This is a *tool* after all, supposed to make things easier rather than tedious.  I have it easy that I'm adding just 3 fields.  What if 1000.  Would I have to tediously and individually "add" them to the subtype one at a time when they are defined clearly on the super-type??

     

  • Jim Divoky
    Jim Divoky
    20 Posts

    Re: Newbie: How to insert filler fields into existing type tree?

    ‏2013-09-26T21:32:06Z  

    Let's not get too caught up in semantics.  I also said that I couldn't add them directly to NM until after I added them to OBX.  That should probably read "...add them directly to NM until after I dragged them to OBX."

    Initially, I "dragged" them from the ST types into OBX.  This works and appears to be fine.  After saving the tree analyzes successfully.

    So, now the OBX has the 3 additional Filler text fields.  The NM type doesn't visually inherit them (so maybe I'm misunderstanding what WTX type tree is showing me). 

    I still cannot "drag" the Filler types from the ST tree into NM, but it does allow me to "drag" the Filler types from the OBX tree to NM.  However, I did just notice that this "drag" invokes a "move".  That is, when I drag the Filler elements from OBX to NM, I just realized that they no longer appeared in the OBX record.  This explains the L100 error.  It also tells me I must be OK to have the filler types in the OBX type, but does not answer how to *extend* those into the NM type.

    So, taking the hint, I *added* them to the NM type.  The tree is still OK.  I also now see the fields in my map. 

    There must be an easier way.  This is a *tool* after all, supposed to make things easier rather than tedious.  I have it easy that I'm adding just 3 fields.  What if 1000.  Would I have to tediously and individually "add" them to the subtype one at a time when they are defined clearly on the super-type??

     

    Semantics is very important if you want someone to understand what you're doing.  There is a big difference between between drag and drop which as you noted is a "move" and adding or copying fields. It's possible the order in which it is done may make a difference also but I'm not sure about that.

    If you were creating a new type tree,You would merely "copy" the OBX as NM and everything would be inherited. In fact that may have worked here, i.e., modify OBX as required, delete NM, and copy OBX as as child of itself name "NM".  Not positive though.  I'd have to try it. You are correct though. Making changes can be tedious. 

    BTW, best practices call for never, ever modifying WTX Industry Pack type trees.  Unfortunately sometimes  you have to.

    Good luck to you.  I can't imagine working with WTX and HL7 with no formal WTX training.  OTOH, sometimes that scenario generates work for me.