Phil Sanders
Phil Sanders

Reputation: 11

Need help - .net programming

Im trying to configure a button in a .net healthcare application with the aid of a wizard that allows 3rd party integrations with other applications.

The process has been documented, including the scripting in a PDF document produced by the manufacturer (siemens) and distributed to me as an IT administrator.

Im now trying to configure the integration button and thankfully there is a test button as part of the wizard that verifys the script - which is returning the error:

"Expression is a value and therefore cannot be the target of an assignment"

I have no experience with programming so im hopefull some kind sole will give me some pointers:

here is the script:

Option Strict Off

Imports System

Imports System.Windows.Forms

Module Script
Sub Main()
dim patientId as string
dim accessionNumber as string
dim parameters as string
dim strFiles as string

' get the patient ID and accession number from the currently
'selected row in the list of job search or advanced search

patientId = ScriptApplication.GetValueFromContextServer(1)
accessionNumber = ScriptApplication.GetValueFromContextServer(2)

strFiles = (System.Environment.GetFolderPath(environment.SpecialFolder.ProgramFiles))

  'create command

     Command = strFiles + "\Siemens\syngo\bin\ialauncher.exe"
    'parameters = "-type READ -l SYNGOVIA\jbrea -p jbrea -a " + accessionNumber
   parameters = "-type READ -lwwc -a"+ accessionNumber

' launch command

System.diagnostics.process.start(command, parameters)  
 End Sub 

End Module

the line below "create command" seems be be causing the problem. This is the executable that should launch, displaying the same patient in ialauncher.exe

Thanks in advance

\Flanders

Upvotes: 1

Views: 219

Answers (2)

Ivan Rey
Ivan Rey

Reputation: 177

I added the missing code. I hope it helps. (Just delete the comment beside it.)

Option Strict Off

Imports System

Imports System.Windows.Forms

Module Script
Sub Main()
dim patientId as string
dim accessionNumber as string
dim parameters as string
dim strFiles as string
dim Command as string  'add this to your code.

' get the patient ID and accession number from the currently
'selected row in the list of job search or advanced search

patientId = ScriptApplication.GetValueFromContextServer(1)
accessionNumber = ScriptApplication.GetValueFromContextServer(2)

strFiles = (System.Environment.GetFolderPath(environment.SpecialFolder.ProgramFiles))

  'create command

     Command = strFiles + "\Siemens\syngo\bin\ialauncher.exe"
    'parameters = "-type READ -l SYNGOVIA\jbrea -p jbrea -a " + accessionNumber
   parameters = "-type READ -lwwc -a"+ accessionNumber

' launch command

System.diagnostics.process.start(command, parameters)  
 End Sub 

End Module

Upvotes: 3

Eight-Bit Guru
Eight-Bit Guru

Reputation: 9971

What type is the Command variable? I bet it's not a String, which it should be.

It's not DIMensioned anywhere that I can see, so try adding

Dim Command As String

just below the Dim for strFiles.

Upvotes: 1

Related Questions