Bill
> --
> 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
>
The subscripts have to be suffixed .gbl, .cls, .hl7 to indicate what they are.
e.g. This method builds an array of many things from my ABC package.
ClassMethod CreateExportXML(FileName As %String, excludedata As %Boolean = 1)
{
if $g(FileName)="" set FileName="C:\temp\ABCExport.xml"
//loop through various groups of items in the ABC application
// Get list of all classes in the ABC package
set x=$system.OBJ.GetPackageList(.classList,"ABC")
set class=""
for {
set class=$order(classList(class))
continue:class["Contextsys"
continue:class["Processsys"
quit:class=""
//skip generated classes (ending in .Context or .Threadn)
set last=$p(class,".",$l(class,"."))
if '((last="Context")||($e(last,1,6)="Thread")) {
set list(class_".cls")=""
}
}
set x=$system.OBJ.GetPackageList(.classList,"ABC")
set class=""
for {
set class=$order(classList(class))
continue:class["Contextsys"
continue:class["Processsys"
quit:class=""
//skip generated classes (ending in .Context or .Threadn)
set last=$p(class,".",$l(class,"."))
if '((last="Context")||($e(last,1,6)="Thread")||($e(last,1,7)="Context")||($e(last,1,6)["Processsys")) {
set list(class_".cls")=""
}
}
// Get list of all classes in the Transplant package
set x=$system.OBJ.GetPackageList(.classList,"Transplant")
set class=""
for {
set class=$order(classList(class))
continue:class["Contextsys"
continue:class["Processsys"
quit:class=""
//skip generated classes (ending in .Context or .Threadn)
set last=$p(class,".",$l(class,"."))
if '((last="Context")||($e(last,1,6)="Thread")||($e(last,1,7)="Context")||($e(last,1,6)["Processsys")) {
set list(class_".cls")=""
}
}
// Get list of all classes in the EnsMonitor2 package
set x=$system.OBJ.GetPackageList(.classList,"EnsMonitor2")
set class=""
for {
set class=$order(classList(class))
continue:class["Contextsys"
continue:class["Processsys"
quit:class=""
//skip generated classes (ending in .Context or .Threadn)
set last=$p(class,".",$l(class,"."))
if '((last="Context")||($e(last,1,6)="Thread")||($e(last,1,7)="Context")||($e(last,1,6)["Processsys")) {
set list(class_".cls")=""
}
}
//get all the business rules in package ABC
set tRS=##class(%ResultSet).%New("Ens.Rule.RuleDefinition:EnumerateRules")
set tSC=tRS.Execute()
while tRS.Next() {
set tPackage=tRS.Data("Package")
set tName=tRS.Data("Name")
if (tPackage["ABC")||(tName["ABC")||(tName["ABC")||(tPackage["ABC") {
set list(tPackage_"."_tName_".rul")=""
}
}
//export the credentials global
set global="^Ens.Conf.CredentialsD"
set list(global_".gbl")=""
//^SYS("BI") global stored the subject areas
//set global="^SYS"
//set list(global_".gbl")=""
/* these are no longer needed - they are DeepSee 1
// Get list of all globals matching ^BI.*
set global="^BI"
for {
set global=$order(^$GLOBAL(global))
quit:($e(global,1,4)'="^BI.")
set list(global_".gbl")=""
}
*/
// Get list of all globals matching ^ABC.*
//but don't export the large patient and admission globals unless explicitly told to.
set global="^ABC"
for {
set global=$order(^$GLOBAL(global))
quit:($e(global,1,5)'="^ABC.")
continue:(excludedata&(global="^ABC.DemoData"))
continue:(excludedata&(global="^ABC.PatientD"))
continue:(excludedata&(global="^ABC.PatientI"))
continue:(excludedata&(global="^ABC.AdmissionD"))
continue:(excludedata&(global="^ABC.AdmissionI"))
continue:(excludedata&(global="^ABC.AdmissionRequestD"))
set list(global_".gbl")=""
}
// Get list of all globals matching ^Tran.*
set global="^Tran"
for {
set global=$order(^$GLOBAL(global))
quit:($e(global,1,5)'="^Tran")
set list(global_".gbl")=""
}
//individually specify any other items here, such as CSP pages
// Get list of DeepSee Folders
set global="^ABC.Demo"
set list("^DeepSee.FolderD.gbl")=""
set list("^DeepSee.FolderI.gbl")=""
set list("^DeepSee.FolderItemD.gbl")=""
set list("^DeepSee.FolderItemI.gbl")=""
set list("^DeepSee.UserPreferences.gbl")=""
set list("^DeepSee.UserPortalSettigs.gbl")=""
//set list("/csp/"_$zu(5)_"/EHRpatientView.csp")=""
; Get all the CSP classes and csp files
set dir=$system.CSP.GetFileName("/csp/"_$zu(5)_"/")
set rs=##class(%ResultSet).%New("%File:FileSet")
set tSC=rs.Execute(dir,"*.*",,0)
for {
quit:rs.Next()=0
set file=rs.GetData(1),file=$p(file,"\",$l(file,"\"))
;break
continue:(file'["ABC")&(file'["ABC")
set list("/csp/"_$zu(5)_"/"_file)=""
}
; Get all the files from ./pimages
set dir=$system.CSP.GetFileName("/csp/"_$zu(5)_"/pimages/")
set rs=##class(%ResultSet).%New("%File:FileSet")
set tSC=rs.Execute(dir,"*.*",,0)
for {
quit:rs.Next()=0
set file=rs.GetData(1),file=$p(file,"\",$l(file,"\"))
set list("/csp/"_$zu(5)_"/pimages/"_file)=""
}
;
set list("Pharm_2.3.HL7")=""
//having built up the array, we can now export it
zw list
do $system.OBJ.Export(.list,FileName)
}
}
Hi,
Thank you,
Bala
--