Friday, September 30, 2022

Count records in csv file and group duplicates in PowerShell

#
#  Output number of images per study form input file list
#   used to validate data in PACS Export and Transfer in October 2022
#   Why:  Needed to process a 400K item list of images files and group by study accession number with total of images see dicom files with python.


$dicomimages = Import-Csv  -Delimiter "," -Path .\DicomFilelist-20220928-135709.csv

$studylistcount = $dicomimages |Group-Object -Property AccessionNumber

[System.Collections.ArrayList]$dicomtruth = @{}



$studylistcount |ForEach-Object {

    $studygrp=$_.Group



     $count= $_.count

     $acc = $_.name

     $mrn = $studygrp| Select-Object -ExpandProperty PatientID -First 1

     $description =  $studygrp| Select-Object -ExpandProperty SeriesDescription -First 1

     $StudyDate =  $studygrp| Select-Object -ExpandProperty StudyDate -First 1

     $StudyInstanceUID  =  $studygrp| Select-Object -ExpandProperty StudyInstanceUID -First 1

     

    $line = [pscustomobject]@{  

            StudyUID = $StudyInstanceUID

            PatientMRN = $mrn

            AccessionNumber = $acc

            StudyDate = $StudyDate

            StudyDescription = $description

            NumberofImages = $count

            }

        $dicomtruth.add($line)|Out-Null    

        }

     $truthfile = "c:\support\dicomtruth-" + $(get-date -f yyyyMMddhhmm) + ".csv"

     $truthfile

     $dicomtruth |Export-Csv -Path $truthfile

Wednesday, July 13, 2022

Domain Setup 101

1.      Find a domain.

a.       https://instantdomainsearch.com/

2.      Purchase the domain

a.       Use GoDaddy or other domain sellers

3.      Purchase email

a.       Purchase email with the domain if needed

4.      Connect domain to your funnel or website

a.       Add domain

b.      Copy the IP to your DNS record

c.       Add www also if this is a top-level domain

d.      Connect your domain to site or funnel

5.      Test

a.       Connect to your domain site or funnel

b.      Try on multiple devices if possible


Thursday, June 30, 2022

Setup DICOM dcmtk Tool kit

How to setup the "dcmtk" DICOM tool

The DICOM Toolkit (DCMTK) can be installed on many platforms. It is a set of command line tools for use with the DICOM and PACS systems.  The extension for DICOM "when used" files is .dcm

DICOM standard ("Digital Imaging and Communications in Medicine"), which was first published in 1993, has become widely accepted.

The beginnings of the standard

Since the 1970s, when computed tomography was introduced as the first digital modality, the importance of digital medical image processing has increased permanently. The emerging idea of a digital image archive (PACS) and electronic image distribution in a hospital created the need to exchange digital images between medical devices of different manufacturers. 

    Ref: https://dcmtk.org/dcmintro.php.en

1. Install Chocolatey

Reference:
https://chocolatey.org/install


Run PowerShell as administrator.



Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Windows -> run -> cmd

close command prompt window and open new command prompt admin console

1. Install dcmtk

Reference:
        https://dcmtk.org/

then run

choco install dcmtk

Thursday, February 24, 2022

Adobe PDF Script Calculate Age

 This is the script to calculate age in Adobe Acrobat Pro.  


This works but throws a internal error.


================================================

// Calculate Age 

// Ref: https://community.adobe.com/t5/acrobat-sdk-discussions/how-to-override-a-calculation-with-manual-entry-in-results-field/td-p/10856126


console.println("Calc Age Started");

var dobValue = getField("DOB").value;


if (dobValue!="") {


var dob = util.scand("mm/dd/yyyy", dobValue);


var today = new Date();


// compute years on full year only


var AgeCalulated = today.getFullYear() - dob.getFullYear();


// adjust for months before month of birth


if (today.getMonth() < dob.getMonth()) AgeCalulated = AgeCalulated - 1;


// adjust for today's month equal to dob's month and today's date before the date of birth


if ((today.getMonth() == dob.getMonth()) && (today.getDate() < dob.getDate())) AgeCalulated -= 1;


//event.value = AgeCalulated;

    console.println("Calc Age Proceess Start");

    getField("AGE").value=AgeCalulated;

    console.println("Calc Age Proceess Finished");


}

Thursday, February 3, 2022

Logoff Disconnected Users with 1 line of PowerShell

 This is the simple way to logoff disconnected users with 1 line of PowerShell


########################################################
# Script to log off Disconnected users on local users
# Ref: https://searchenterprisedesktop.techtarget.com/blog/Windows-Enterprise-Desktop/Logoff-Disconnected-Win10-Users-Via-Command-Line
# Ref Post By: Ed Tittel 24 Sep 2018
#######################################################
# Larry Billinghurst - 3 Feb 2022
#######################################################

quser | Select-String "Disc" |ForEach {logoff ($_.tostring() -split ' +')[2]}






Thursday, January 27, 2022

QR Code in 5 Lines

 # pip install pillow

# pip install qrcode
# ref: https://towardsdatascience.com/generate-qrcode-with-python-in-5-lines-42eda283f325



import qrcode
# Link for website
input_data = "https://towardsdatascience.com/face-detection-in-10-lines-for-beginners-1787aa1d9127"
#Creating an instance of qrcode
qr = qrcode.QRCode(
        version=1,
        box_size=10,
        border=5)
qr.add_data(input_data)
qr.make(fit=True)
img = qr.make_image(fill='black', back_color='white')
img.save('qrcode001.png')

Monday, November 15, 2021

Technology Management Role

 

These are most of the tasks that are performed for technology management in a business

  1. Manage system recovery
  2. Reduce technology friction
  3. Provide technology guidance
  4. Measure technology systems performance and processes
  5. Manage technology uptime and availability
  6. Manage technical risk, compliance, controls, and process
  7. Manage data protection and lifecycle
  8. Manage technology costs and budget
  9. Manage technology security 
  10. Manage user and system access
  11. Manage user experience
  12. Manage technology training programs
  13. Manage technical issues and problems
  14. Manage technology adoption
  15. Manage email, websites, and social media systems
  16. Manage technology vendors, suppliers, and partners
  17. Manage cloud resources
  18. Manage software and applications
  19. Manage servers, workstations, laptops, and all technology assets
  20. Manage networking systems LAN, WAN and Wireless
  21. Manage technology hardware lifecycle
  22. Manage business phone and fax systems
  23. Manage mobile phones and devices