First of all your source message is missing one segment , i corrected it. below code should work for you .


  set target = ##class(EnsLib.HL7.Message).%New()
  set target.DocType = source.DocType
  write $System.Status.GetErrorText(source.BuildMap(1))
  set tSC = $$$OK
  try {
      set segCount = source.SegCount
      for segNo=1:1:segCount {
        set oSegment = source.GetSegmentAt(segNo)
        set segPath = source.GetSegmentPath(segNo)
        
        set fieldCount = oSegment.GetValueAt("*")
        for fieldNo=1:1:fieldCount {
          set fieldValue = oSegment.GetValueAt(fieldNo)
          set compCount = oSegment.GetValueAt(fieldNo_".*")
          
          for compNo=1:1:compCount // considering there is no repeat - if repeat then one more loop is required
            set subCompCount = oSegment.GetValueAt(fieldNo_"."_compNo_".*")
            for subCompNo=1:1:subCompCount {
                set path = segPath_":"_fieldNo_"."_compNo_"."_subCompNo
                set subCompValue = source.GetValueAt(path)
                
                if (subCompValue '= "") && (subCompValue '= ($C(34)_$C(34))) {
                  //if (oSegment.Name = "PID")&&(fieldNo=2) break
                  if path="PIDgrp.PID:13.4.1" break
                  write path_"--->"_subCompValue,!
                  do target.SetValueAt(subCompValue,path)
                }
            }
          
          }
          //set componentCount = oSegment.GetValueAt(fieldNo
        }
      }
      do target.OutputToFile("C:\Work\Report\target.hl7",1)
    
  catch oEx {
     }

You can do like this as well in case you want to use DTL only ..

<transform sourceClass='EnsLib.HL7.Message' targetClass='EnsLib.HL7.Message' sourceDocType='2.3.1:ADT_A01' targetDocType='2.3.1:ADT_A01' create='copy' language='objectscript' >
<assign value='$extract(source.{MSH:Receivingfacility},1)' property='target.{MSH:Receivingfacility}' action='set' />
</transform>
}
 

I am using MSH:6 but you can use anything here.

In case you need to use any use written function you can create a class extending  "Ens.Util.FunctionSet."

Any class method we write in the class will be added in your DTL method option .

Hi David,

I am not sure of any handy solution but I would like to suggest one "frugal innovation" here. It might not fit the exact requirement but it can be of some help if changing the table structure is permitted.

if possible change the date field to integer/float and convert the whole date time to seconds .

while storing the data first convert the date to horolog , it would come like 65380,73921.1234

Then convert the date to seconds by (65380 * 24 * 3600) + 73921.1234

index on this column is going to perform better. Let me know if its possible in your case.

Run %GSIZE if you see any orphan globals please kill ,or take necessary action.

Then go to 

1. Management portal

2. System Operation

3. Databases

4. Top left Corner - "Freespace "

5. You will see a list of dbs

6. every row extreme right you will see 2 links "compact" and "truncate"

7. First do a compact

8. check background job if successful Got to #9 else repeat #7

9. truncate the db

Yes we are 2 different jobs for UI and back-end deployment.

Our cache back-end gets deployed first if back-end is successful we do go ahead with UI deployment.

For cache Unit testing you need to handle it from cache code. We have one shell script which does call the cache object script deployment code and internally our cache deployment script runs the unit test(and code coverage).

For angular its easy using maven , Jenkins has in built functionlity for Angular with Maven

I do not think you need to upgrade to 2017/18 before upgrading to 2019. Yo can directly upgrade to 2019 , but you need to change few classes manually.

Whats the format of your backup , is it dat files? I guess its safe to take the data backup(not code)

The code backup cannot be restored directly into 2019 as there are few library change. One of the main change that needs to be done manually is JSON library changes.

Does this answer your question.

Do you want server side explorer?

If so please have a look at this

/// Demonstration of launching a file selector window. 
ClientMethod showFileSelectionWindow() [ Language = javascript ]
{
zenLaunchPopupWindow('%ZEN.Dialog.fileSelect.cls','FileSelection','status,scrollbars,resizable,width=500,height=700');
}

/// This client event, if present, is fired when the a popup page
/// launched from this page fires an action.
ClientMethod onPopupAction(popupNameactionvalue) [ Language = javascript ]
{
switch(popupName) {
case 'FileSelection':
if (action=='ok');{
alert('My File is:'value);
///Do something...
}
break;
}
}